Re: Quark - search and replace.
Re: Quark - search and replace.
- Subject: Re: Quark - search and replace.
- From: Hans Haesler <email@hidden>
- Date: Mon, 25 Apr 2005 09:12:05 +0200
On Fri, 22 Apr 2005, Ruby Madraswala wrote:
>Can anyone tell me what's wrong this script, all I am trying to do is
>replace words with correct accents. it replaces apart of the word or
>overwrites part of previous word. Each search/replace a different behavior.
Ruby,
do you use, by any chance, an XTension like "Xcatalog"? Then there
are invisible tags in your text and XPress is unable to position
the new text correctly.
Replace 'every text' with 'every word'. This is slower, but should
work. To speed up execution you could use 'do script' as shown here:
---
property searchTextList : {"revls", "travls", "cordón", ... and so on ...}
property replaceTextList : {"revZs", "travZs", "cord-n", ... and so on ...}
tell application "QuarkXPress"
activate
do script {searchReplace}
end tell
script searchReplace
repeat with i from 1 to (count of searchTextList)
set searchText to (item i of searchTextList)
set replaceText to (item i of replaceTextList)
tell document 1 of application "QuarkXPress"
try
set (every word of every story where it is searchText) to replaceText
end try
end tell
end repeat
end script
---
Please note that you don't need 'items in' and there is no need
for coercing the items 'as string' since they are already strings.
Regards,
Hans
---
Hans Haesler <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden