Re: QuarkXpress find and replace with variables (new question)
Re: QuarkXpress find and replace with variables (new question)
- Subject: Re: QuarkXpress find and replace with variables (new question)
- From: "Arthur J Knapp" <email@hidden>
- Date: Sat, 27 Jan 2001 12:52:38 -0500
>
Date: Fri, 26 Jan 2001 23:18:45 +0100
>
From: Hans Haesler <email@hidden>
>
Subject: RE: QuarkXpress find and replace with variables (new question)
>
here are three solutions which consider case.
[snip]... Good stuff
>
The third solution preserves local formatting by saving the text as
>
XPress Tags to a file. Then it reads it in a variable, performs the S&R
>
(using RegEx), writes the text to a file before loading it in the text box.
>
property list1 : {"one", "One"}
>
property list2 : {"uno", "Uno"}
...
>
repeat with i from 1 to count of list1
>
set list1item to item i of list1
>
set list2item to item i of list2
>
set storyOne to (REReplace storyOne pattern list1item with list2item)
>
The RegEx command line can be replaced by the call of the S&R handler
>
of the first solution.
>
>
One problem, however, is not solved: how do you make sure that you don't
>
get unwanted changes, e.g. "alone" modified to "aluno"?
Just take advantage of the RegEx patterns:
REReplace storyOne with "uno" pattern "\\<(one)\\>" ignoreCase (false)
Where \< and \> are word boundry symbols.
Leonard Rosenthol's documentation for the RegEx commands is very
good, and his implementation of regular expressions is even more
sophisticated than that provided by BBEdit, (well, BBEdit version
5.1.1 and before, at least).
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
"...well the rain falls down
without my help, I'm afraid
and my lawn gets wet,
though I withheld my consent..."
}