Working with a text selection in Quark
Working with a text selection in Quark
- Subject: Working with a text selection in Quark
- From: Rob Stott <email@hidden>
- Date: Wed, 10 Oct 2001 09:19:43 +0100
Hi, I'm trying to write an applescript which will substitute every occurance
of a capital letter W with a lower case w in a given selection - I'd have
thought it would be pretty easy but I'm running into problems. The script so
far is;
tell application "QuarkXPress"
set theTotalCharacters to the count of the characters of the selection
repeat with i from 1 to theTotalCharacters
if character i of the selection is "W" then set character i of the
selection to "w"
end repeat
end tell
It works for the all the script except for the last character of the
selection which gets the following error;
get character 300 of selection
--> QuarkXPress got an error: Can't get character 300 of selection.
(I'm testing it on a text box filled with 300 capital W's)
Can anyone give me any hints as to where I'm going wrong?
Thanks in advance
Rob
--
"When two or more people agree on an issue, I form on the other side." -
Bill Hicks