Re: Quark guide placement scripting
Re: Quark guide placement scripting
- Subject: Re: Quark guide placement scripting
- From: Hans Haesler <email@hidden>
- Date: Tue, 6 Nov 2001 21:40:30 +0100
On Tue, 6 Nov 2001, Bill Planey wrote:
>
Does anyone know if it is possible to script the placement
>
of a vertical ruler guide that directly superimposes the flashing
>
text cursor?
I guess you want page guides, so the script tries to get the
number of the page where the box is sitting. Another variable is
set to 'left of bounds' of the box. A third variable is set to
the horizontal offset of the flashing cursor. The fourth variable
holds the addition of both values. Each position is added to
the list 'posList' and, finally, the guide is created.
---
property posList : {}
tell document 1 of application "QuarkXPress 4.11"
tell current box
set nPage to page number of page 1
set x1 to left of bounds as point units as real
end tell
set xOff to horizontal offset of selection as point units as real
set hPos to (x1 + xOff)
set end of posList to hPos
tell page nPage
make vertical guide at beginning with properties {position:(hPos & "pt") as text}
end tell
end tell
posList
---
>
Is it then possible to refer to Vguide 1, Vguide 2,
>
Vguide 3 (etc.) and have the script refer to that position as a
>
distance from the Zero mark?
I'm not sure if I understand your question. But my idea is to
store each position in 'posList'.
>
Also - is it possible to script the setting of the Zero Point
>
at the X,Y coordinates of an existing text box?
---
tell document 1 of application "QuarkXPress 4.11"
set page rule origin to {0, 0}
tell current box
set orB to origin of bounds
end tell
set page rule origin to orB
end tell
---
As always, these snippets don't have any error handling.
The first one expects a text box which is selected with the
Content tool. The box must be positioned on a page.
The second snippet is less demanding.
For both, the 'Item coordinates' must be set to "Page".
(But none of them is "dangerous" ;-)
HTH,
Hans
---
Hans Haesler <email@hidden>