RE: Indesign CS5 - getting width and height of selection?
RE: Indesign CS5 - getting width and height of selection?
- Subject: RE: Indesign CS5 - getting width and height of selection?
- From: email@hidden
- Date: Tue, 07 Feb 2012 17:16:46 +0100
hi Havard,
You could do something like this, I moved the element for easy calculation, but you could cross reference with the bounds of the pages, in that case you could leave the element on its place. Anyway this is hopefully something useful.
tell application "Adobe InDesign CS5.5"
set mySelection to selection
set myDoc to active document
tell myDoc
if (count of mySelection) > 1 then
set myItem to make group with properties {group items:(mySelection)}
else
set myItem to item 1 of selection
end if
set {y1, x1, y2, x2} to geometric bounds of myItem
move myItem to {0, 0}
set {ny1, nx1, ny2, nx2} to geometric bounds of myItem
set theHeight to ny2
set theWidth to nx2
set geometric bounds of myItem to {y1, x1, y2, x2}
if (count of mySelection) > 1 then
ungroup myItem
end if
display dialog "the height is " & theHeight & ""
display dialog "the width is " & theWidth & ""
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden