• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Working with a text selection in Quark
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working with a text selection in Quark


  • Subject: Re: Working with a text selection in Quark
  • From: Frank Miedreich <email@hidden>
  • Date: Wed, 10 Oct 2001 23:22:13 +0200

hi,

while I do not know what causes the error message, the following snippet would do the replacement without problems. Note though that xpress is not case sensitive in the where clause, thus replacing lower case w as well. wrapping this in a considering case block makes no difference.

cheers, Frank


tell application "QuarkXPress Passport 4.11"
tell document 1
tell the selection
set (every text where it is "W") to "w"
end tell
end tell
end tell

At 9:19 Uhr +0100 10.10.2001, Rob Stott wrote:
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



--


References: 
 >Working with a text selection in Quark (From: Rob Stott <email@hidden>)

  • Prev by Date: Re: Updating scripts/applets company-wide
  • Next by Date: Re: Making JPEG thumbnails of PDF files
  • Previous by thread: Working with a text selection in Quark
  • Next by thread: Re: Working with a text selection in Quark
  • Index(es):
    • Date
    • Thread