Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quark - Find and Replace -addendum




Am 23.03.2007 um 22:14 schrieb Oakley Masten:

I modified it a bit to test to see if all code numbers
were actually what they were suppose to be.
Following is my rewrite:

property refList : {}
property refList2 : {}

tell application "QuarkXPress"
	tell document 1
		tell text box 50
			tell text 1
				set refList to object reference of every text
whose contents is "#102"
				set refList2 to object reference of every text
whose contents is "#"
				--return refList
				set CountItems to count of items in refList
				set CountItems2 to count of items in refList2
				return CountItems & CountItems2
			end tell
		end tell
	end tell
end tell

This works really well.  Which brings up another
question
How do I get it to test the whole document without
checking each individual box?  I tried but failed to
get the correct syntax for it.

Just get a list of all text boxes then loop thru the boxes list and collect the result in a list:

set resultList to {}
tell application "QuarkXPress"
tell document 1
set textBoxRefList to every text box
repeat with aTextBoxRef in textBoxRefList
tell aTextBoxRef
tell text 1
set aTextRefList to (object reference of every text whose contents is "#102")
set aTextRefList2 to (object reference of every text whose contents is "#")
set CountItems to count of items in aTextRefList
set CountItems2 to count of items in aTextRefList2
set aResult to {CountItems, CountItems2}
set end of resultList to aResult
end tell
end tell
end repeat
end tell
end tell
return resultList


Peter

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Quark - Find and Replace -addendum (From: Oakley Masten <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.