Re: QuarkXPress origin of bounds property
Re: QuarkXPress origin of bounds property
- Subject: Re: QuarkXPress origin of bounds property
- From: Hans Haesler <email@hidden>
- Date: Wed, 5 Sep 2001 17:17:32 +0200
On Wed, 5 Sep 2001, Helmut Fuchs wrote:
>
Does anybody know whether the components of the origin property can
>
be accessed independently (using QuarkXPress 4.11 under MacOS 9)?
>
>
I'm trying this:
>
set vertical of origin of bounds of boxRef to newVerticalPosition
>
>
Which fails, because there seems to be no "vertical" property of
>
origin (although there should: it's documented). I'm aware that I can
>
read the origin property, convert it to a list, change the vertical
>
component and write the list back, but I'm afraid to introduce stupid
>
rounding errors by doing this.
Helmut,
try this:
---
tell document 1 of application "QuarkXPress 4.11"
activate
tell current box
set {y, x} to origin of bounds as list
set origin of bounds to {(y as real) + 5, x}
end tell
end tell
---
Note that the measurement units must correspond to the value
of the distance to change (here '+ 5').
If you know that the units are always 'millimeters', then the
snippet will work as expected if you want to move the box using
'millimeters'. Else you can test the units at the beginning of
the script and change them - temporarily - if necessary.
Another possibility: coerce the position to a measurement unit...
---
..... (y as millimeter units as real) .....
---
... but then the result of the whole operation must be completed
by the corresponding unit:
---
set origin of bounds to {"" & ((y as millimeter units as real) + 5) & "mm", x}
---
There is no rounding problem. I selected a box. The y-value of
'origin of bounds' is 112.888885498047 before running the script.
Afterwards it returns 117.888885498047.
Both values appear in the measurements palette with the same
decimal positions: .889
Best regards,
Hans
---
Hans Haesler <email@hidden>