Skip to content

Instantly share code, notes, and snippets.

@JMichaelTX
Last active November 10, 2024 04:58
Show Gist options
  • Save JMichaelTX/d29adaa18088572ce6d4 to your computer and use it in GitHub Desktop.
Save JMichaelTX/d29adaa18088572ce6d4 to your computer and use it in GitHub Desktop.
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

  • I like starting with the videos in the Introduction.
  • You won't be able to understand or remember everything the first time through, but it should help to give you the big picture, and maybe a few concepts.
  • After you have read some of the other references, and played around with JXA for a while, you may find it worthwhile to view the video's again -- I picked up a lot more my second viewing.
  • The same thing goes for the Apple Release Notes. These will be much more meaningful the 2nd or 3rd time you read them (at least it was for me)
  • I am still learning JXA, just like you. So please feel free to post any suggestions/corrections that you may have.

Important Requirements

  • You must be running at least macOS Yosemite (10.10.3) to use JXA
  • It is best to be running macOS El Capitan (10.11.6) or later, since a number of JXA bug fixes and enhancements were made.

Introduction

  1. Video -- JXA Introduction by Sal Soghoian, post 2014 WWDC (~25 min), 2014-10-11
  2. Video -- 2014 WWDC session video on JXA. (can view ONLY in Safari), (~53 min), 2014-06-02

Official Apple Reference

  1. Mac Automation Scripting Guide -- AppleScript & JXA, 2016-06-13
  2. JXA Release Notes in Yosemite 10.10, 2014-10-17
  3. JXA Release Notes in El Capitan 10.11, 2015-09-16
  4. AppleScript Language Guide
    • Although this guide provides examples in AppleScript, almost all of the concepts and commands also apply to JXA.
    • Use this guide as needed to obtain more insight into Mac automation via scripting
  5. Scripting Reference Forms
    • This is one section of the guide that applies fully to both AppleScript and JXA, just a difference in syntax.

Debugging

  1. Debugging JXA with the Safari Web Inspector, 2015-09-16, OS X 10.11 Release Notes
  2. Video -- How to Debug JXA Scripts with Safari Debugger, 2016-06-20, YouTube Video by JMichaelTX.
  3. Debugging JXA Scripts with Safari Debugger, 2016-06-20, by JMichaelTX

Getting Started

  1. JXA: Getting Started with Javascript for Automation, 2014-12-02, by Alex Guyot at macstories.net.
  2. Extensibility and Automation Changes in OS X Yosemite, 2014-10-17, by Alex Guyot at macstories.net.
  3. A Beginners Guide to JXA (with Alfred examples), 2016-10-10, by Richard Guay at tutsplus.com.
  4. How to Install AppleScripts or JXA Scripts, 2016-02-13, by JMichaelTX.

Third Party Reference

  1. JXA Cookbook Wiki, Started 2014-10-28, by Thai Pangsakulyanont (dtinth) and others.

Using JXA with Objective-C and Cocoa

  1. Objective-C Bridging with AppleScript & JXA, 2016-03-21
  2. Using Objective-C with JXA (JXAObjC), 2015-09-16
  3. Using Objective C (ObjC) with JXA (JXA Cookbook), 2017-06-24

User Forums with Topics on JXA

  1. Keyboard Maestro Topics Tagged with JXA
  2. Stackoverflow.com Questions Tagged with JXA
  3. Stackoverflow.com Questions Tagged with javascript-automation

JavaScript Resources

Although the focus here is JXA, clearly a good knowledge of the core JavaScript is essential. So here's my list:

  1. JavaScript Ref Guide, Tutorials, & Documentation -- Mozilla
  2. Douglas Crockford's Javascript Web Site
  3. JavaScript: The Good Parts -- by Douglas Crockford (Kindle Edition)
  4. A Smarter Way to Learn JavaScript -- by Mark Myers (Kindle Edition)
@0xmikelee
Copy link

@JMichaelTX wow! this is perfect! thanks for putting this together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment