Hmm, interesting. It certainly looks wrong.
I see that OG is up to v. 6.5.2 now, so perhaps your older version isn’t compatible with newer OSs.
Also, I seem to recall that only the “Pro” version is scriptable (though I could be wrong). Worth checking, though.
Omni Group has pretty responsive support, as well as forums including one on AppleScript.
FWIW, here’s what I get when I create a new document, add a rectangle (with the default gray fill), and “Copy as AppleScript”:
tell application id "com.omnigroup.OmniGraffle6" tell canvas of front window make new shape at end of graphics with properties {draws shadow: false, size: {341.000000, 211.000000}, origin: {291.000000, 318.000000}, fill color: {0.749020, 0.749020, 0.749020}} end tell end tell
HTH (and you’re welcome :-)
—RL
On Apr 9, 2016, at 17:08 , Christian Boyce < email@hidden> wrote:
When I try the "Copy as AppleScript," I get an AppleScript that won't work:
tell application "OmniGraffle" tell canvas of front window make new shape at end of graphics with properties {(null): {227.613281, 79.898438}, (null): {250.699219, 135.812500}, (null): {0.404275, 0.333180, 1.000000}} end tell end tell
The "null" stuff has to be wrong. This is OmniGraffle 4.1.2, Mac OS 10.11.4.
This was the easiest test case I could make: a new document, one shape in it (rectangular). But it didn't work.
What a wild, crazy, fabulous feature this could be for me though. I've never heard of such a thing. Thank you for pointing it out!
On Apr 7, 2016, at 12:18 PM, Rob Lewis < email@hidden> wrote:
One feature that can be a godsend is the command to “Copy as AppleScript”. You can just make a selection in your drawing and then use this command. It will place the AppleScript code to recreate the item(s) on the clipboard. From there you can paste it into your script and tweak as desired. (I suppose you could store the code in a field in your database, too.)
|