Hi, OmniGraffle automators!
Are you comfortable programming in JavaScript? Are you comfortable testing early builds? We just shipped our first public test builds of OmniGraffle 7.3 for Mac, which implements most of what we think is needed to get started with automating the app using JavaScript. (The upcoming OmniGraffle 3 for iOS will also include the same support, but it’s not quite ready for TestFlight yet.)
You can download the latest build here:
And when you have that build installed and open, you can use this link to enable its JavaScript support:
- omnigraffle:///change-preference?OJSEnabled=true
You might need to restart the app at that point to get it to notice the changed setting, but once you’ve done that there will be a new Scripts menu with commands like Show Console
and Documentation
.
The built-in documentation is very bare bones right now, but Sal Soghoian is putting together a website that goes into a lot more depth about how to actually use the scripting environment (with sample code, etc.). You’ll find it over at omni-automation.com.
Also, you can select some shapes on a canvas and use Edit > Copy As > JavaScript to get some code which creates those shapes. However, be forewarned that I just found three bugs in the code it created (all easy enough to work around, but definitely something we want to fix before all this ships). [EDIT: These bugs are now fixed, so I removed the extra details describing how to work around them.] If you notice any other bugs, please don’t hesitate to report them.
And if you have any questions, please don’t hesitate to ask! The sooner we hear from you, the sooner we’ll be able to figure out how best to improve what we’re building.
P.S. — The latest test builds of OmniOutliner 5 have similar support, which can be enabled in much the same manner:
- omnioutliner:///change-preference?OJSEnabled=true