QuarkXPress 6.5-Changing Text Tracking Based on Text Color

Hello,

I’m trying to see if I can script Quark 6.5 to go through all text boxes in a document, and if the text is a certain color, set the tracking of the text to 0.
I know how to set up the repeat loop, and I know that resetting the tracking via Applescript is possible, but I can’t seem to get Quark to change the tracking based on the color.

Here’s what I’ve got so far (doesn’t work):


tell application "QuarkXPress"
	tell document 1
		repeat with i from 1 to the count of every text box
			if color of story 1 of text box i is "Red" then set track of every story of text box i to "0"
		end repeat
	end tell
end tell

Any help is greatly appreciated!

Dave

Quark doesn’t like to get certain properties in a way that you can if-then them. If you get properties of a text box that has red text in it, it will return “Red”, but for some reason you can’t say if the color is “Red” then do something. I finally came up with something that works:

tell application "QuarkXPress"
	tell document 1
		set BoxList to (uniqueID of every text box whose color of story 1 is "Red") as list
		tell (every text box whose uniqueID is in BoxList)
			set properties of story 1 of it to {track:"0"}
		end tell
	end tell
end tell

Model: Mac G5 OS 10.3.9
Operating System: Mac OS X (10.3.9)

tell application "QuarkXPress"
	tell document 1
		set BoxList to (uniqueID of every text box whose color of story 1 is "Red") as list
		tell (every text box whose uniqueID is in BoxList)
			set properties of story 1 of it to {track:"0"}
		end tell
	end tell
end tell

Thanks, Matt-Boy…

I tried this on a Quark doc with 3 text boxes, 2 of which had red type and non-zero tracking. When I ran the script, Quark threw this error:

QuarkXPress got an error: Can’t set properties of story 1 of every text box of document 1 whose {7, 6} contains uniqueID to {track:“0”}.

I’m seeing your logic, however…gonna try to chew on this to see if I can get it to work. Thanks again!

This one seems to work for me:

tell application "QuarkXPress"
	tell document 1
		set BoxList to (uniqueID of every text box whose color of story 1 is "Red") as list
		repeat with i from 1 to count of text boxes
			set boxName to uniqueID of text box i
			if boxName is in BoxList then
				set properties of story 1 of text box i to {track:"0"}
			end if
		end repeat
	end tell
end tell

Thanks again, Matt-Boy. I wouldn’t have thought of going the list route.