Re: Replace text on spesific page
Re: Replace text on spesific page
- Subject: Re: Replace text on spesific page
- From: Hans Haesler <email@hidden>
- Date: Mon, 15 Nov 2004 20:59:16 +0100
On Mon, 15 Nov 2004, Steve Foster wrote:
> I have a quark document which holds a text box containing the
>placeholder «TITLE». I need to duplicate this page and change the
>placeholder to «TITLE2» on page two than «TITLE3» on page 3 etc.
Steve,
the script does what it is told: on each iteration, it sets
every text of every story of the document to the current value.
If you're looking closely, then you'll see it counting up.
BTW, how come it works for you, when starting with «TITLE»
and it looks for «TITLE1»?
The error message when you add 'tell page i' is generated
because only a document or a text box have a 'story' property.
You'll get a different number on each page with inserting
a 'tell text box 1' and replace 'every story' by 'story 1'...
---
tell application "QuarkXPress 4.11"
activate
set recordCount to 4 --can be any amount
repeat with i from 1 to recordCount
tell document 1
tell page i
tell text box 1
set (every text of story 1 where it is "«Title" & i & "»") to "«Title" & (i + 1) & "»"
end tell
end tell
duplicate page i
end tell
end repeat
end tell
---
... but the initial «TITLE1» is changed to «TITLE2». To avoid this,
there is a simpler solution (see below).
But first: What version of QuarkXPress are you using?
And under what version of Mac OS?
Is your document (or project) a facing pages one?
Where should the duplicated pages be inserted?
Are the other elements on the first page?
Else, why don't you just _insert_ the pages?
Then you could place the text box with the placeholder
on the Master page(s). Insert the cursor between the "e"
and the "»", hold down the Command key and type a "3".
The result will look like "«Title<#>»". The three signs
are an automatic page number which will be converted
automatically on the Layout side.
And the script--using QXP 5 thru 6.5--would be something like this
(look, Ma, no Repeat loop :-)...
---
tell application "QuarkXPress 6.5"
activate
set recordCount to 6
tell document 1
make page at end with properties {quantity:recordCount}
end tell
end tell
---
... or--using QXP 4.11:
---
tell application "QuarkXPress 4.11"
activate
set recordCount to 6
repeat with i from 1 to recordCount
tell document 1
make page at end
end tell
end repeat
end tell
---
Hans Haesler <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden