July 17, 2015
Here's a short JXA script I use to open some folders, open up terminal, cd and open Atom, my text editor of choice.
var term = Application('terminal') term.includeStandardAdditions = true; term.doScript('cd /Users/mike/project/ && open .'); var atom = Application('Atom'); atom.includeStandardAdditions = true; atom.activate();
The project isn't really called project, but you get the idea, that's a lot less clicking every day, right there.
Ruby & Python are still available as part of the scripting bridge set-up, I think, but neither's even presented as an option in the stock script editor (hidden away in /Applications/Utilities/), so they're even further behind in terms of support.
I'd use Swift, I love Swift, but scripting with Swift still means building almost every single component you're going to use, from reading folder contents and files on up, all by yourself, and then rewriting all of those components every few months as the language introduces breaking changes. I've been playing around with automating git downloads & builds this week & almost everything I tried as a test had been broken on the language upgrade wheel, the dependency manager Carthage included. If you script in Swift you're still mostly on your own.
So for automating Mac apps, JXA it is, and for other automation… well, more on that soon.