The short answer is No. In fact I’m more disheartened at the state of inter-application scripting now than I was a year ago.
I began working on the application in January 2014, but hadn’t touched the project since last June. I got a bit bogged down with it, and it was by far too big a project to start with; I’d just finished the Big Nerd Ranch Objective-C and Cocoa books and while they were very good, and I learnt loads, I should’ve made some toy applications by myself before tackling it.
In short, it would have been a GUI application that created both preset and custom batches of InDesign documents and changed certain elements on those pages (dates, page numbers), with the user having the ability to change those presets.
One of the biggest hurdles was working with AppleScript from Cocoa. I had to define a category on NSAppleScript to make bearable calling AppleScript handlers (from a compiled
.scpt file used as a library). And this was my first attempt at a Cocoa programme without the help of the BNR books! It was a mess (that category is a mess, but it does work) and I got discouraged.
But when I come back to it, that will be the way I’ll do it, because the other options are so poor.
A “native” Cocoa option is Scripting Bridge. It hasn’t been updated since 10.6, but so what? If it works, it works. It doesn’t work. The generated header for InDesign is 10MB and Xcode hangs when you try to open it. The thousands of enums, typedefs, interfaces, methods and properties even bring BBEdit to its knees when you try to use the function menu or “Named Symbol…” browser.
Well, OK, let’s settle for not being able to properly browse the header, and just include it and poke around. Nope! Xcode won’t compile with it included (because of about 20 errors, mostly “duplicate” definitions that come from flattening InDesign’s enormous scripting dictionary).
.get() all about?) There’s no interface to call such scripts from Cocoa. And the preliminary change notes for OS X 10.11 don’t contain any significant changes.
This year’s WWDC talk on automation was Supporting the Enterprise with OS X Automation. At the start, Sal Soghoian — Mr Automation at Apple — says:
Some days I feel like I’m a dinosaur looking for a tar pit
It’s not looking good.