3 ms·
You can certainly write automation code using JXA or SB. Or you can just skip straight past the end where you `/dev/null` the lot in steaming frustration, and
by hhas02 5y ago
You can certainly write automation code using JXA or SB.
Or you can just skip straight past the end where you `/dev/null` the lot in steaming frustration, and go back to using AppleScript because, as much as it stinks as a language, it’s the only nominally supported option that actually works.
Calling JXA and SB abandoned unsupported incompetent trash is, frankly, an insult to all the abandoned unsupported incompetent trash out there (I’m looking at you RN, npm).
The worst bit is, the Mac Automation team had absolutely zero excuse for botching SB and JXA. The first might be forgivable (because everyone screws up their first AppleEvent bridge—I certainly did), but to ruin two—and do so when this was already a solved problem. And Apple knew this was a solved problem, because they were also considering Python and Ruby appscript for inclusion in Mac OS X 10.5 at the same time as SB was being developed internally.
Alas, Peter Principle, Dunning-Kruger, and Not Invented Here won out[1]; Scripting Bridge shipped, sucked donkey gonads, and immediately sank without trace. Then a few years later JXA did it all over again.[2]
There is a reason why Apple finally fired the Mac Automation Product Manager and disbanded the whole damn team. The tragedy is, while AppleScript itself is a wonderful, awful failure in end-user language design, the underlying AppleEvent IPC infrastructure and the Apple Event Object Model that apps build atop it comes very close to true greatness: a high-level, highly consistent, query-driven UI/UX that for a time was damn near ubiquitous across every major productivity and recreational application.
That query-powered UI ought to be at the heart of Apple Siri today, as Siri’s entrypoint into 1000s of professional and consumer apps, not mouldering in a corner because not a single person left inside Apple even realizes what a treasure chest they sit on, even now. So it goes.
--
[1] a.k.a. Sal Fecking Soghoian. Though really this was my 100% fault: because I was a dumbass who thought “Mission Complete” when Apple approached me about appscript, not realizing that was only the foot in the door. What I immediately should’ve done was find out what dev was sponsoring it and asked what they needed in order to sell it internally to all the decision makers that count. Lesson belatedly learned.
Pro-tip to y’all: When an org like Apple comes knocking on your door, saying “We’re interested in your work…”, the correct answer is “YES! What do you need from me to help make this work?”, not “Oh neat. Wait a minute while I go tidy stuff up…” Because you will not get a second chance.
[2] Again, Sal Soghoian; a man incapable of learning from his own errors, never mind everyone else’s. If only Apple had hired Cal Simone, who actually knew what he was doing and how to sell it.