RE: Quark Find and Replace with variables (new question)
RE: Quark Find and Replace with variables (new question)
- Subject: RE: Quark Find and Replace with variables (new question)
- From: Aaron Miller <email@hidden>
- Date: Mon, 29 Jan 2001 09:39:00 -0700
>
Aaron,
>
>
here are three solutions which consider case.
>
BUT... with #1 and #2 any local formatting will be lost.
>
If this would be a problem, then, please, consider solution #3...
>
---
>
property list1 : {"one", "One"}
>
property list2 : {"uno", "Uno"}
>
on open y
>
tell application "QuarkXPress 4.11"
>
activate
>
open y
>
tell document 1
>
set newStory to story 1 of text box 1
>
repeat with i from 1 to count of list1
>
set list1item to item i of list1
>
set list2item to item i of list2
>
set newStory to my searchReplace(list1item, list2item, newStory)
>
end repeat
>
set story 1 of text box 1 to newStory
>
end tell
>
end tell
>
end open
>
>
on searchReplace(sStr, rStr, tStr)
>
set AppleScript's text item delimiters to sStr
>
set aList to (every text item of tStr)
>
set AppleScript's text item delimiters to rStr
>
set tStr to aList as string
>
set AppleScript's text item delimiters to {""}
>
return tStr
>
end searchReplace
Hans,
That is incredibly simpler compared to what I was going to try next (messing
with ACSII numbers still within QuarkXpress). I opted for option 1 for my
own vanilla purposes (mostly because I am still fairly new to AS and want to
get a strong hold of vanilla commands before I go on to osaxen). Two
questions, if you don't mind, about approach 1:
1. What formatting is changed in case 1? I used it on a test document with
font size, color and type all different from the default setting and all of
those were preserved.
2. Could you explain to me what is going on in the handler, particularly how
the delimiters are working? I must have a wrong idea of how they work,
because that isn't very clear to me there what they are doing.
Thanks to all for working on my problem and helping me with it. If you ask
me, one of the best parts about AS is the community.
Aaron
Aaron Miller - Macintosh Specialist
Morinda, Inc.
email@hidden
(801) 234-2609