Re: finding reference to spread of generic box in QuarkXPress
Re: finding reference to spread of generic box in QuarkXPress
- Subject: Re: finding reference to spread of generic box in QuarkXPress
- From: Hans Haesler <email@hidden>
- Date: Thu, 31 Jan 2002 08:39:23 +0100
On Thu, 31 Jan 2002, Helmut Fuchs wrote:
>
I have written a Handler that gets a text box as a parameter. Now I
>
want to find out on which spread the box resides. I'm using the
>
following construct to achieve this:
>
>
-- inTextBox is a reference to any textbox of any page of any document
>
<<class from>> of ((get object reference of inTextBox) as record)
>
--> resulting in "spread x of document "yyy"
>
>
Is there a better way to achieve this? (I.e. without undocumented
>
coercing of references to records).
>
>
And how would I get access to the page a box resides on?
Helmut,
try this:
---
tell document 1 of application "QuarkXPress 4.11"
tell current box
set objRef to object reference of page 1
set nPage to name of page 1
end tell
set nSpread to index of spread 1 of objRef
end tell
{"Page: " & nPage, "Spread: " & nSpread}
-->{"Page: 20", "Spread: 3"}
The result of 'name of page 1' is a string with the "real" page
number (important when a Section Start has been set).
Using 'page number of page 1' results in an integer which is
the number of the page of the Layout palette.
---
Hans Haesler <email@hidden>