Replace with different text or by using counter
Replace with different text or by using counter
- Subject: Replace with different text or by using counter
- From: Elmer Banate <email@hidden>
- Date: Fri, 17 May 2002 05:50:42 +0800
Hi to all,
I need to replace the word "LIBRARYNAME" in my quark document to the name of
items in the library I created.
The script must replace not one replace string. example "LIBRARYNAME" will
be replaced to "FG01" after replacing the first word ("LIBRARYNAME") in the
next replace is "FG02" and soon, depending on how many occurrences, if
"LIBRARYNAME" occurred 22 time the last replacement text is "FG22".
I'm trying to use counter but my counter doesn't work.
I suspect the my problem is around here:
set (every text of stories where it is search_string) to replace_string
--------
tell application "QuarkXPress 4.11"
set FigName to "FG0"
tell document 1
try
set LibName to every text of every story where it is
"LIBRARYNAME" as list
end try
set ctr to 1
repeat with i from 1 to the number of items in LibName
set search_string to item i of LibName
set replace_string to FigName & ctr as string
try
set (every text of stories where it is search_string) to
replace_string
set ctr to ctr + 1
end try
end repeat
end tell
end tell
TIA
Regards
elmer
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.