Re: AppleScript-Users Digest, Vol 4, Issue 479
Re: AppleScript-Users Digest, Vol 4, Issue 479
- Subject: Re: AppleScript-Users Digest, Vol 4, Issue 479
- From: Kevin McIntosh <email@hidden>
- Date: Wed, 03 Oct 2007 16:03:40 -0500
- Thread-topic: AppleScript-Users Digest, Vol 4, Issue 479
Ed,
Thanks for the help.
I found and edited this script and it worked!
set searchTextList to {"MW100", "MW101", "MW102", "MW103"}
set replaceTextList to {"2X495", "2X789", "2X958", "2X455"}
tell application "QuarkXPress"
tell document 1
end tell
end tell
repeat with i from 1 to (count of items in searchTextList)
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
Now I just have to figure out how to format my list of part numbers like the
ones above. Always something!
Thanks,
Kevin
> Hey Kevin,
>
> At first glance here's what I notice about your script:
>
>
>> script 1
>
>> tell application "QuarkXPress"
>
>> open file "wc_marine_b"
>
> --here Quark is expecting a file reference or an alias.
> --It can't identify your file by name. try Something like
>
> open file "HD:Afolder:wc_marine_b" would work, or
>
> open (choose file)
>
>> script 2
>
>> tell "wc_marine_b"
>
> -- in this case Quark is looking for a more fully formed document reference.
>
> Tell document 1
> --or this might work
>
> Tell document "wc_marine_b"
>
>> try
>> set every text of stories whose it = searchTextList to replaceTextList
> --It may have been email formatting, but the on error needs to be on a new
> line.
>
> on error number -10006 -- search string not found -- handle the error, as
> HTH,
>
> ES
_______________________________________________
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