quark Object Reference HELP
quark Object Reference HELP
- Subject: quark Object Reference HELP
- From: Oakley Masten <email@hidden>
- Date: Wed, 25 Apr 2007 09:36:55 -0700 (PDT)
On April 24th AppleScript Master Practitioner Stan
Cleveland wrote:
-- grab text (not object references) from Quark
tell application "QuarkXPress"
set findText to "cannot"
set objRefList to object reference of every text of
story 1 of text box1 of page 1 of document 1 where
it's text is findText
set objRefCount to count of objRefList
set theStory to contents of story 1 of text box 1 of
page 1 of document1
--> "Gravitation cannot be held responsible for
people falling in love. Gravitation cannot be held
responsible for people falling in love. Gravitation
cannot be held responsible for people falling in
love."
end tell
-- use applescript (not Quark) to 'measure' each
occurrence the text
set textLen to length of findText
--> 15
set offsetList to {}
set currentOffset to 1
repeat with i from 1 to objRefCount
set currentOffset to currentOffset + (offset of
findText in (text currentOffset thru -1 of theStory))
--> 14, 81, 148
set end of offsetList to currentOffset
end repeat
-- now go back to Quark for each occurrence of
extended text
tell application "QuarkXPress"
repeat with thisOffset in offsetList
set startOffset to thisOffset - 1
set endOffset to startOffset + textLen - 1 + 15 --
15 = length of extension to text
set extText to object reference of text from
character startOffset to character endOffset of text
box 1 of page 1 of document 1
-- manipulate each block of text as needed
set font of extText to "Arial Black"
set color of extText to "Blue"
end repeat
end tell
Thanks Stan - I can make this work.
Oakley
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden