JavaScript for Automation Cookbook
JavaScript for Automation is a new thing in Mac OS X Yosemite. It allows you to control applications using JavaScript language. How awesome!
However, its documentation covers the basics of using JavaScript to interact with the Open Scripting Architecture. For many tasks in scripting, there's a lot to figure out, and many different documentations to refer to.
So I created this JavaScript for Automation cookbook that features a lot of examples, such as:
- How to display alert, prompt and confirm dialogs.
- How to run shell scripts.
- How to create a command-line script (shebang script) and read
argv
arguments.
Where it makes sense, I try to link to the official documentation as much as possible so you can dive deeper.
For ease of editing and contribution, the contents are on the wiki.