Home/Q&A/AppleScript vs Shortcuts vs JXA: which to use for automation on a remote Mac?

AppleScript vs Shortcuts vs JXA: which to use for automation on a remote Mac?

Updated · airankrush

Direct answer

It depends on the task. For fine control of one app, choose AppleScript; for chaining a few ready-made actions, choose Shortcuts; JXA can do essentially what AppleScript does, with far less documentation.

Basis

  • AppleScript and JXA are both text files, and both are run by osascript (JXA with the -l JavaScript flag). Text files can go into Git and can be edited and run from the terminal, so you do not depend on the remote desktop when the picture is laggy.
  • Shortcuts are stored in the app's own library and are edited by dragging actions in a graphical interface, so you can only work on them through the remote desktop. The upside is that there is no code to write, and they can be shared with the shortcuts on your phone through iCloud.
  • The three can call one another: Shortcuts has actions for running AppleScript and running shell scripts, and a script can call a shortcut with shortcuts run. A common combination is Shortcuts for the overall flow, with the awkward step handed to a script.
  • All three face the same system permissions: controlling other apps needs Automation permission and simulating clicks needs Accessibility permission, whichever language you pick.

Information as of .

Boundaries: when the answer is different

If your process does not involve macOS apps at all and only calls APIs or handles files, none of the three is a good choice; Python or a shell script is more straightforward, and you may not need a Mac at all. JXA has very little official documentation, and when you get stuck you will usually have to look up the AppleScript way and translate it yourself, so it is not recommended for a new project when nobody on the team knows it. Shortcuts are hard to code-review or diff, and maintenance cost climbs quickly once a flow gets complicated. This comparison is about the tools only; each app supports the three to a different degree, so go by that app's scripting dictionary and its list of Shortcuts actions.

Use case

This question belongs to the use case: iMessage, AppleScript and Shortcuts on a rented Mac mini: it runs, but Apple decides about your account

Other questions in the same use case:

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All Q&A