Applescript: How to create a group or subgraph?
The only way I have had luck with so far is to make the shapes directly on the canvas, and then use [B]assemble[/B] to put them into a subgraph or group.
Is there a way to [B]create[/B] new shapes with [B]at=aSubgraph.graphics.end[/B]? Or to add existing shapes to an existing subgraph? And lastly, is there a way for a script to select elements for auto-layout only of the selected ones? Thanks! |
[CODE]set theResult to [B]assemble[/B] [I]reference[/I] ¬
subgraph [I]boolean[/I] ¬ table shape [I]list[/I][/CODE] On restricting auto layout on the basis of selection, I think you might have to create a temporary layer at run-time, to temporarily hold the subset (defined by selection status) which you want to lock or unlock for auto-layout. |
This kind of code seems, as I think you have probably already discovered, to trip an exception:
[CODE]tell application id "OGfl" tell canvas of front window set refSubGraphics to a reference to graphics of first item of subgraphs set oShape to make new shape at end of refSubGraphics with properties {size:{90, 90}} end tell end tell[/CODE] 27/11/2012 10:13:29.247 OmniGraffle Professional: An exception was thrown during execution of an NSScriptCommand... 27/11/2012 10:13:29.247 OmniGraffle Professional: *** NSMapInsert(): attempt to insert notAKeyMarker (Might be worth asking [B]Help > Send Feedback[/B] whether that is by design) but this seems to work: [CODE]tell application id "OGfl" tell canvas of front window set refSubGraphics to a reference to graphics of first item of subgraphs set oShape to make new shape with properties {size:{90, 90}} move (oShape) to end of refSubGraphics end tell end tell [/CODE] [COLOR="White"]--[/COLOR] |
All times are GMT -8. The time now is 03:09 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.