Re: Working with QuarkXPress bounds
Re: Working with QuarkXPress bounds
- Subject: Re: Working with QuarkXPress bounds
- From: Hans Haesler <email@hidden>
- Date: Thu, 26 Feb 2004 22:54:01 +0100
On Thu, 26 Feb 2004, Steve Roy wrote:
>
Thanks Hans, that's pretty convoluted but it works. (Can't Quark
>
make anything simple?) However the units I get are in whatever
>
the units are set for the document, whereas I need to make sure
>
that what I get is in points. How could I do this?
Two possibilities:
1) coerce the values to points;
2) save the settings of the document, set the units temporarily
to points, do your stuff, restore the original units.
With the first solution you'll have to insert the measurement
units everywhere:
---
set y1 to y1 as point units as real
---
A shot description of the second solution:
The flag 'mes' is set to '0'
The current measurement units are stored in the variables
'vMes' and 'hMes'.
Then they are tested. If any of them is not 'points' then
the flag is set to '1' and the units are set to 'points'.
The script can now get and set values in points without
specifying the measurement unit each time.
At the end the flag is tested. If its value is '1' then
the measurement units are set back to what they have been
at the beginning.
---
tell document 1 of application "QuarkXPress 4.11"
activate
set mes to 0
set vMes to vertical measure
set hMes to horizontal measure
if vMes is not points or hMes is not points then
set mes to 1
set properties to {vertical measure:points, horizontal measure:points}
end if
--
-- do your stuff
--
if mes = 1 then
set properties to {vertical measure:vMes, horizontal measure:hMes}
end if
end tell
---
Okay?
---
Hans Haesler <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.