• 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
Re: Replace text on spesific page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replace text on spesific page


  • Subject: Re: Replace text on spesific page
  • From: Steve Foster <email@hidden>
  • Date: Tue, 16 Nov 2004 11:26:14 +0000

Absolutely brilliant. Have it working spot on («TITLE» SHOULD HAVE SAID «TITLE1», my mistake!)

I was close yet so far!!!

Thanks loads.

Steve


On 15 Nov 2004, at 19:59, Hans Haesler wrote:

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>



Steve Foster
Head of Online Development
email@hidden
01709 364721
01709 515285
http://www.globe-media.com

_______________________________________________
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


References: 
 >Re: Replace text on spesific page (From: Hans Haesler <email@hidden>)

  • Prev by Date: Save EPS page from Acrobat
  • Next by Date: Re: List of users/accounts
  • Previous by thread: Re: Replace text on spesific page
  • Next by thread: AS for MySQL
  • Index(es):
    • Date
    • Thread