Re: How to name a text box on a Master Page
Re: How to name a text box on a Master Page
- Subject: Re: How to name a text box on a Master Page
- From: email@hidden (Michael Sullivan)
- Date: Wed, 14 Nov 2001 13:59:13 -0500
- Organization: Business Card Express of Connecticut
>
I am trying to name a text box on a maaster page in order to copy text into
>
it. I am running MacOS 9.1 with AS 1.5.5. The Quark version is 4.1. Can
>
anyone help me with this?
>
I run the script with the document open, the master page is current and the
>
text box is selected. The script finishes running without error, however,
>
the results indicate that the box wasn't named.
>
>
By the way, I am working in Script Editor.
>
>
The script I am using is :
>
>
tell application "QuarkXPress(tm) 4.1"
>
tell document 1
>
set properties of text box 1 to {name:"sentiment"}
>
get name of text box 1
>
set BoxName to name of text box 1
>
BoxName
>
end tell
>
end tell
>
>
I sure hope one of you good people has the right answer to this. Thanks in
>
advance for your responces.
The problem here is that the text box you want to name isn't *in*
document 1.
It's probably naming the instance of the text box on page 1 (or whatever
text box 1 of document 1 is.
It could be having a problem with doing the naming if it *is* the
instance, because you have the master page open.
What you want to do is to:
tell application "QuarkXPress(tm) 4.1"
tell master document 1
set properties of text box 1 to {name:"sentiment"}
get name of text box 1
set BoxName to name of text box 1
BoxName
end tell
end tell
See if that works. You might have to address the specific spread, which
will generally have the name "A-Master A", unless you've named it
differently.
In fact, I think (and this would be a bug) you may have to address:
"page 1 of spread "A-Master A"
in order to do anything on the master page.
There are a lot of idiosyncrasies to scripting master pages in Quirk,
but these are some of the most fundamental:
1. Master pages are not in document X, but in "master document X"
2. When applying master pages to internal pages, they are addressed as
spreads, not pages.
3. Many operations on master spreads that would work on regular spreads
appear to fail. (It may be just that the syntax is idiosyncratic and I
haven't figured it out -- I haven't reported these as bugs or done any
real testing). Fortunately, addressing the page instead of the spread
has fixed everything I've come across.
4. Page 1 of a spread gets created when you create the spread.
Those are the big ones I ran into that I beat my head against for way
too long. There's a lot of Quark scripters on here that may have
further tips. Scripting master documents appears to be something of a
black art.
Michael
--
Michael Sullivan email@hidden
Business Card Express of Connecticut Thermographers to the Trade
"You hate your job -- why didn't you say so? There's a support group
for that. It's called everybody; they meet at the bar." -Drew Carey