Automation for OS X: the JavaScript way