Loading...

applescript-users@lists.apple.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: Indesign CS5 - getting width and height of selection? jan . bultereys Tue Feb 07 09:10:02 2012

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
end tell


Best regards,
jan




InDesign CS5.I have a multiple objects selected. How can I get the width and 
height (as shown as H and W in the Control Panel).(Selection may be several 
objects within different groups on different layers.)Håvard 
_______________________________________________Do not post admin requests to 
the list. They will be ignored.AppleScript-Users mailing list ([EMAIL 
PROTECTED])Help/Unsubscribe/Update your 
Subscription:https://lists.apple.com/mailman/options/applescript-users/jan.bultereys%40skynet.beArchives:
 http://lists.apple.com/archives/applescript-usersThis email sent to [EMAIL 
PROTECTED]
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/applescript-users/alexiscircle%40gmail.com
Archives: http://lists.apple.com/archives/applescript-users

This email sent to [EMAIL PROTECTED]