Question

I've recently discovered AppleScript. AppleScript affords a simple, natural way to programmatically simulate keyboard-and-mouse interaction with Mac applications. AppleScript is great, however it suffers from the following problems:

  1. The latest stable release is from 2014, and last year the AppleScript product manager was laid off and his position was eliminated.

  2. The official documentation has not been updated since January 2016, and all of the tutorial and reference books that are dedicated to AppleScript date no later than 2010 (with the exception of this one, which seems to be a copy-and-paste of some stackexchange Q&A with the AppleScript tag).

  3. Script Editor, the built-in AppleScript development environment, has no debugging capabilities. There seems to be just one commercial IDE for AppleScript*. It looks amazing and has all the debugging features that one would expect from a modern IDE, but it costs $100, which would be too expensive for my pocket even if Apple did not seem to be phasing out this programming language (see bullet point #1).

Are there any alternatives to AppleScript? Is there an actively developed and supported programming language with a good, cheap IDE, and good, up-to-date documentation, that makes it possible to simulate keyboard-and-mouse interaction with Mac applications in a quick and easy way? Something, maybe, like the Apple counterpart for Microsoft's VBA (Visual Basic for Applications) for their Office suite on Windows?


* It appears there's another third-party AppleScript IDE: Smile. Unlike Script Editor, Smile is free of charge.

Was it helpful?

Solution

First of all: DON'T PANIC :)

No, there are no good/useful/less painful alternatives to Automator/AppleScript. At least not if you really need to automate some workflow within the UI.

OTHER TIPS

Since Yosemite, OS X/macOS also supports JavaScript as an inter-process scripting language--officially known as JavaScript for Automation, also referred to as JXA. The documentation (and some would say, the implementation) is somewhat lacking compared to AppleScript, but if you're already more familiar with JavaScript than AppleScript, then it might be an option.

Like AppleScript, JXA also offers an ObjC bridge allowing you to use Cocoa APIs in your JavaScript.

One advantage is that there are many more editors and IDEs out there designed for JavaScript coding than there are for AppleScript, though Script Editor and Automator probably still have the edge for debugging JXA-specific stuff.

Official resources:

Some unofficial resources:

Script Debugger, which you mention, is free for most uses, with a $99.99 USD fee, (1-2 users), only for certain advanced features.

I wouldn't be too worried by the lack of development: the language is very stable, and apps (including those by Apple) continue to have support for AppleScript.

For instance, Preview's AppleScript capabilities have improved since 2014.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top