Search and replace script (Quark)
Search and replace script (Quark)
- Subject: Search and replace script (Quark)
- From: Kevin McIntosh <email@hidden>
- Date: Tue, 02 Oct 2007 19:48:37 -0500
- Thread-topic: Search and replace script (Quark)
I would like to be able to replace part#'s throughout a Catalog layout (a
lot of part numbers!) in Quark and have found the following scripts related
to my needs (found in this email list). The only problem is I can't get
them to work.
The issue that seems to come up is a "undefined" error for the file name
"wc_marine_b" which is the quark file I would like the script to edit. Also
a "undefined" error on the word "stories" in the second action. This only
occurs after I put "wc_marine_b" into "".
Here are scripts I am trying to use:
script 1
--------
set searchTextList to {"MW100", "MW101"}
set replaceTextList to {"2X1803", "2X1804"}
tell application "QuarkXPress"
open file "wc_marine_b"
end tell
repeat with i from 1 to (count of items in searchText)
set searchText to (item i of searchTextList) as string
set replaceText to (item i of replaceTextList) as string
tell application "QuarkXPress"
tell front document
set (every text of every story where it is searchText) to replaceText
end tell
end tell
end repeat
--------
script 2
---------
set searchTextList to {"MW100", "MW101"}
set replaceTextList to {"2X1803", "2X1804"}
tell application "QuarkXPress"
tell "wc_marine_b"
try
set every text of stories whose it = searchTextList to replaceTextList on
error number -10006 -- search string not found -- handle the error, as
desired
end try
end tell
end tell
-------
Any help would be greatly appreciated...
:)
Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden