Re: QXP5 - A matter of facing pages and bounds of selected objects
Re: QXP5 - A matter of facing pages and bounds of selected objects
- Subject: Re: QXP5 - A matter of facing pages and bounds of selected objects
- From: mathom <email@hidden>
- Date: Wed, 21 Apr 2004 08:25:38 -0600
Luca,
To get the measurements you want, I think you need to control the
setting of the "Item coordinates" preference. Your result indicates
that it is set to "spread" rather than "page". You can script this with
the "item spread coords" document property like so:
set item spread coords to false
I hope that helps.
-mathom
On Apr 20, 2004, at 4:34 AM, Luca BASSINI wrote:
I wrote a little script that copy in a variable the bounds of current
box (this could be all selected box in a page).
Here is the code I wrote:
tell application "QuarkXPress Passport 5.01"
tell document 1
set theBounds to (bounds of current box) as list
copy theBounds to {y1, x1, y2, x2}
set y1 to y1 as string
set x1 to x1 as string
set y2 to y2 as string
set x2 to x2 as string
return (y1 & "|" & x1 & "|" & y2 & "|" & x2) as string
end tell
end tell
And If I select all the objects in a page, here is the returned value:
-3 mm|202 mm|282 mm|410 mm
My problem is that these are absolute bounds; I mean: this document
has facing pages on its master document... The items I selected are on
the first page which is an odd page... So relative bounds should be
something like:
-3 mm|-3 mm|282 mm|205 mm
because the width of every page is 205 mm... So the problem is:
1) trying to understand if I'm working on a odd or an even page
This could be done with this code:
tell current spread
if (count of pages) = 2 then
set leftPage to name of page 1
set rightPage to name of page 2
else
set thePage to name of page 1
end if
end tell
If I convert the name of the page, I can use the number I got (i.e.
"1", "2", "3")...
2) is there a way to understand if a number is a even or odd number?
Having solved this problem, I could decide if I have to remove from
the x1 and x2 bounds the width of the page... But this is good only
one of the selected object starts out of the bounds of current page...
So... :-(
Any idea?
Regards
Luca
_______________________________________________
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.
_______________________________________________
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.