• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Indesign CS5 - getting width and height of selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indesign CS5 - getting width and height of selection?


  • Subject: Re: Indesign CS5 - getting width and height of selection?
  • From: Håvard Graudo <email@hidden>
  • Date: Wed, 08 Feb 2012 13:10:16 +0100

Jan, 

Thank you for the code, it does work, but I was hoping to just get the values without changing the items. 
There will be surprises with grouping across layers, items may belong to other groups etc. 

Skipping the MOVE part and only group and calculate (y2-y1, x2-x1) would reduce risk a bit, but it is still a roundabout way of getting the values:

Since the values I am after are displayed in the Control Panel I was hoping to just pick them up from somewhere.
If someone knows how to access that info I would appreciate it.

Håvard




Den 7. feb. 2012 kl. 17.16 skrev email@hidden:

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@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Indesign CS5 - getting width and height of selection?
      • From: Shane Stanley <email@hidden>
References: 
 >RE: Indesign CS5 - getting width and height of selection? (From: email@hidden)

  • Prev by Date: Re: Issue with process names
  • Next by Date: Re: Indesign CS5 - getting width and height of selection?
  • Previous by thread: RE: Indesign CS5 - getting width and height of selection?
  • Next by thread: Re: Indesign CS5 - getting width and height of selection?
  • Index(es):
    • Date
    • Thread