search and replace question
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/