The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Crashes when scripting "group rank" property in OmniGraffle Thread Tools Search this Thread Display Modes
Running the following code will crash OmniGraffle 4. I get the same results in OmniGraffle 5. This was obtained using the Copy As Applescript command.
Code:
tell application "OmniGraffle Professional 4"
	tell canvas of front window
		make new shape at end of graphics with properties {origin:{166.0, 166.0}, size:{54.0, 36.0}}
		make new shape at end of graphics with properties {origin:{317.0, 171.0}, rank group:1, size:{54.0, 36.0}}
		make new shape at end of graphics with properties {origin:{83.0, 81.0}, rank group:1, size:{54.0, 36.0}}
		make new shape at end of graphics with properties {origin:{234.0, 86.0}, size:{54.0, 36.0}}
	end tell
end tell
I have tried a number of ways to set the "rank group" property, with no success. Any suggestions?

My goal is to organized a bunch of shapes to the same rank via scripting, in the same way that I would accomplish by selecting them in groups and clicking "Same" under "Object Rank" in the "Advanced Settings" of the "Canvas: Diagram Layout" inspector.

Last edited by timcoffman; 2009-06-14 at 06:01 AM.. Reason: Called "rank group" by the wrong name.
 
I have worked around this problem by
  1. Tagging all objects with a value indicating their intended rank grouping
  2. Selecting sets of objects via that tag value
  3. Using System Events to click the "Same" radio button
This achieves assigning the shapes to their proper rank groupings, still using entirely Applescript.

However, the next problem comes when I ask the canvas to do the Layout. If I first select the "Minimize Crossings" mode, the applications locks up, consuming 100% of the processor, and never performs the layout. I am leaping to the conclusion that it is hitting an infinite loop in the layout code caused by some conflicting constraints due to the object ranks.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to FIND text in columns that have the type property set to "pop-up list" qomni OmniOutliner 3 for Mac 20 2013-12-04 03:18 PM
Access "Wrap To Shape" property from Applescript? Sophie OmniGraffle General 12 2013-01-19 08:50 PM
Can't sort a column when its type property is set to "pop-up list" qomni OmniOutliner 3 for Mac 8 2012-02-02 10:05 AM
Live in NJ/NY? Join the "NY/NJ Wireframing via Omnigraffle - Visio - InDesign group @shawncapizzi OmniGraffle General 0 2011-11-17 12:00 PM
OmniFocus scripts would benefit from a "has subtasks" property RobTrew OmniFocus Extras 0 2010-06-09 03:37 AM


All times are GMT -8. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.