Last Week on My Mac: Withering automation

Last November, there was a period of panic among those who script macOS, when Sal Soghoian left Apple, where he had led its Automation Technologies. Was AppleScript doomed, we wondered? Although there were reassuring noises at the time, that question was finally answered at WWDC last month: Apple has abandoned its automation technologies, leaving them to wither and die.

That may seem a damning statement, but there is extensive evidence to support it.

AppleScript, once the flagship automation technology on Macs, has been drifting for several years now. Apple continues to maintain support for it in many of its own apps, such as Photos, Pages, and Numbers, although ‘pro’ apps like Final Cut Pro X (almost no support) and Logic Pro X (no support at all) are notable exceptions. Maintenance has not yet ceased – Apple did fix one bug in Sierra 10.12.6, for example – but the language and its support are stagnant at best.

Looking beyond Apple’s apps, AppleScript support is notably absent from many fine, award-winning apps, such as Affinity Photo and Designer. Automator also appears to have had very little work other than maintenance performed on it since 2012.

The one faint glimmer of hope was in JavaScript for Automation (JXA). Introduced in OS X Yosemite 10.10, this has not changed significantly since El Capitan, but Apple has now produced its Mac Automation Scripting Guide, which appears to be a new document dated 7 July 2017.

In that guide, Apple makes it clear that the days of AppleScript as the primary Mac scripting system have long gone:
In OS X 10.10, JavaScript became a peer to AppleScript in OS X.

Indeed, the bundled Script Editor in macOS Sierra can be set to make JXA its primary language, and you can browse dictionaries in JavaScript translation (also Objective-C, but not Swift). But before you rush out and start learning JavaScript, you should perhaps read that guide, which demonstrates how difficult it is to use as a general-purpose scripting language for macOS. There are even long series of examples which are only provided in AppleScript, which hardly builds your confidence.

There are some useful resources about JXA, including the JavaScript for Automation Cookbook.

A year ago, those might have appeared quite attractive, but after augmentation and improvement in El Capitan, JXA too has been left to stagnate in Sierra. So, with aged AppleScript, novel JXA, and friendly Automator on offer, the burning question is what is happening with scripting and automation in High Sierra? The answer according to WWDC 2017 is absolutely nothing: no announcements, no new features, no presentations, no workshops.

If Apple still has an Automation Technologies team, it has gone awfully quiet since the departure of Sal Soghoian. None of the existing technologies will have seen any significant improvement in three years, from the release of El Capitan in September 2015, to whatever succeeds High Sierra in (presumably) the autumn of 2018.

Over that same period, Swift has already gone from 2.0 to 4.0, and possibly more.

Some of this decline results, I think, from the feeling that scripting is no longer compelling technology, in the sense that it doesn’t win over new customers to macOS. The case for scripting is, if anything, building more strongly on iOS devices, particularly iPads. On the other hand, any sort of scripting is a security nightmare, and Apple may feel more comfortable setting limits on the security environment and letting others see what they can achieve before making any decisions.

If you’re looking to script apps, you can choose between AppleScript and JXA, according to the support offered by specific apps. But if you’re wanting to use features in macOS, Apple has made it clear that its future is set in Swift. At least – for the time being – that does seem to have a future, rather than just a past.