Re: QuarkXPress find and replace with a variable
Re: QuarkXPress find and replace with a variable
- Subject: Re: QuarkXPress find and replace with a variable
- From: email@hidden
- Date: Wed, 24 Jan 2001 16:26:43 -0700
Your script works should work fine. I normally use copy instead of set, as
in:
set EList to {"one ", "two ", "three "}
set SList to {"uno ", "dos ", "tres "}
tell application "QuarkXPress? 4.11"
tell document 1
tell story 1 of text box 1
repeat with i from 1 to count of SList
set eitem to item i of EList
set sitem to item i of slist
try
copy sitem to (every text where it = eitem)
on error
end try
end repeat
end tell
end tell
end tell
Remember if your script does not find a matching item in the text it will
produce an error (the reason for the try/on error trap). Using the every
text reference produces partial matches; ie: "onerous" would be replaced
with "unorous" if the space were not part of the search strings. Of course,
then you need to look for occurrences of the words followed with a period,
etc. You can use the every word reference if you are looking for complete
words (this will allow you to ignore punctuation but allows you to look for
single words only.)
HTH
Shirley Hopkins
FaceSpan Support
"AppleScripting QuarkXPress"