Re: scripting horizontal guides in Quark
Re: scripting horizontal guides in Quark
- Subject: Re: scripting horizontal guides in Quark
- From: Hans Haesler <email@hidden>
- Date: Wed, 5 Dec 2001 08:43:38 +0100
On Tue, 4 Dec 2001, billp wrote:
>
Does anyone know if there's a way to automate the placement of
>
a horizontal text guide (which visually runs vertical) to exactly
>
overlap the blinking cursor in a text box? What would be the
>
way to tell Quark to place the guide there? Is this even possible?
Bill,
you must have missed my reply from _November_ 6th.
So, here we go again...
I guess you want page guides, so the script tries to get the
number of the page where the box is sitting. Other variables are
set to 'left of bounds' of the box and to the width of the frame
and to the horizontal offset of the flashing cursor. The last
variable holds the addition of all 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
set wF to width of frame as real
end tell
set xOff to horizontal offset of selection as point units as real
set hPos to (x1 + wF + xOff)
set end of posList to hPos
tell page nPage
make vertical guide at beginning with properties {position:hPos as point units}
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>