QXP5 - A matter of facing pages and bounds of selected objects
QXP5 - A matter of facing pages and bounds of selected objects
- Subject: QXP5 - A matter of facing pages and bounds of selected objects
- From: Luca BASSINI <email@hidden>
- Date: Tue, 20 Apr 2004 12:34:21 +0200
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.