• 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
Replace with different text or by using counter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Replace with different text or by using counter
      • From: Jay Young <email@hidden>
    • Re: Replace with different text or by using counter
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: Linked lists (was osascript - path to me)
  • Next by Date: Scripter needed.....
  • Previous by thread: Re: Ping with AS under OS X?
  • Next by thread: Re: Replace with different text or by using counter
  • Index(es):
    • Date
    • Thread