The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   AppleScript loses layout after save? (http://forums.omnigroup.com/showthread.php?t=30413)

cscooper 2013-07-22 07:11 AM

AppleScript loses layout after save?
 
I'm trying to create a chart using AppleScript, letting OmniGraffle do the layout, my script looks like this:

[FONT="Courier New"]tell application "OmniGraffle 5"
make new document with properties {template:"Blank"}
tell canvas of front window
set Node0 to make new shape at end of graphics with properties {text:{alignment:left, text:"blah"}, origin:{100.0, 20.0}, autosizing:full}
set Node1 to make new shape at end of graphics with properties {text:{alignment:left, text:"narg"}, origin:{100.0, 20.0}, autosizing:full}
connect Node0 to Node1
layout
end tell
save document 1 in "/tmp/output.graffle"
end tell[/FONT]

When I run this script, I see my nodes appearing all in one place, then I see the nodes getting nicely laid out as the automatic layout occurs, and then the file gets saved. However, when I close & reopen the file, the layout is gone - all the nodes are on top of each other as if the layout never happened.

What am I doing wrong?

Thanks,
Chris


All times are GMT -8. The time now is 06:03 AM.

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