View Single Post
I'm trying to create a chart using AppleScript, letting OmniGraffle do the layout, my script looks like this:

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


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