• 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: Quark - search and replace.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Quark - search and replace. (From: "Ruby Madraswala" <email@hidden>)

  • Prev by Date: Re: comments stripped out by MV or MVMAC shell script
  • Next by Date: Re: comments stripped out by MV or MVMAC shell script
  • Previous by thread: Quark - search and replace.
  • Next by thread: ASCII code for pc return
  • Index(es):
    • Date
    • Thread