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

search and replace question


  • Subject: search and replace question
  • From: Elmer Banate <email@hidden>
  • Date: Thu, 17 Jan 2002 13:50:14 -0800 (PST)

Hi All,

I'm trying to replace the word "Common" in every
master pages, but when I run my script I'm
encountering this error message "QuarkXPress 4.11 got
an error: every story of master spread of document 1
doesn't understand the searchReplace message."

tell application "QuarkXPress 4.11"
activate
set search_text to {"Common"}
set replace_text to text returned of (display dialog
"Enter text to replace:" default answer "" buttons
{"OK", "cancel"} default button 1)

tell document 1
tell master spread
tell every story
repeat with i from 1 to count of search_text
set search_string to item i of search_text
set replace_string to item i of replace_text
searchReplace(search_string, replace_string)
end repeat
end tell
end tell
end tell
end tell

on searchReplace(s, r, t)
set AppleScript's text item delimiters to (s)
set aList to (every text item of t)
set AppleScript's text item delimiters to (r)
set t to aList as string
set AppleScript's text item delimiters to ""
end searchReplace

TIA
elmer
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


  • Follow-Ups:
    • Re: search and replace question
      • From: Steven Angier <email@hidden>
    • Re: search and replace question
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: compactness of expression question
  • Next by Date: Re: compactness of expression question
  • Previous by thread: Re: how to tell if a particular application is running?
  • Next by thread: Re: search and replace question
  • Index(es):
    • Date
    • Thread