4 ms·
I will also leave these here: appscript.sourceforge.net sourceforge.net/projects/appscript/files github.com/hhas/SwiftAutomation www.npmjs.com/package/nodea
by hhas02 5y ago
I will also leave these here:
appscript.sourceforge.net
sourceforge.net/projects/appscript/files
github.com/hhas/SwiftAutomation
www.npmjs.com/package/nodeautomation
(The nodeautomation bridge on npm is broken due to bitrot in NodObjC; there’s an active fork on my github which works, albeit slowly RN, as I bring it back into operation for new customer work.)
…
Python appscript was, and arguably still is, the single best piece of software I ever wrote. And it wiped the floor with AppleScript. To the scripters and programmers who used it, it was a revelation: 99.9% as good as AppleScript for automating Mac apps, in a language they already know and love.
Protip: Nothing in AppleScript makes sense except in light of relational queries.
Appscript was the first time anyone explained honestly to Mac OS X devs how Apple event automation actually works. Application Automation is not OOP (despite its misleading jargon and superficial appearance). It’s RPC plus simple first-class queries.
It’s most closely related to SQL and RDBMSes—except whereas SQL talks to a handful of virtually identical apps all doing the same thing, here’s a system that talks to hundreds of wildly heterogenous apps; and in a way that is, in principle, accessible to everyone from expert programmers to end users.
Once you know that, all the bafflement and confusion caused by the mismatch between you you think it works and what you see it actually doing evaporates. And not only is it clear, it is also logical and elegant AF. A really nice, thought-out, very-high-level UI/UX; a programmatic peer—and equal—to the Mac GUI.
Instant, irresistable catnip for geeks. Today it should have a technical audience millions strong, powering the heart and userlands of every Apple OS.
…
The first version of appscript (2003–2004) was a failure. It took years for me to fully understand the implications of “Not Object-Oriented, Query-Driven”. By the time Dr Cook was presenting his AppleScript paper at HOPL3, I had eventually figured it out for myself; even so, reading that paper a while later was hugely enlightening and confirmed I finally had a Mental Model that Is Not Wrong. I owe Cook and Harris a debt of gratitude for their work that am still grinding away to pay off.
Anyway…
Back in 2006/2007, Apple approached me expressing an interest in including Python and Ruby appscript in Mac OS X Leopard. Alas, due to my non-existent sales skills and the then-Mac Automation team’s terminal (literally) Not Invented Here Syndrome, that opportunity was lost. Apple shipped its garbage ScriptingBridge.framework, which immediately failed and sunk with barely a trace. (Yes, I was a dunce; but at least I wasn’t the dunce being paid six figures at Apple to utterly feck things up. That was Sal Soghoian’s job.)
By time 2012 rolled around, the bottom had dropped out the Mac Automation market and it was clear it was on its way out. That year I predicted AppleScript would be done within the next 5–10.
When JXA was surprise-announced at WWDC14 (no doubt pissing off the JavaScriptCore team after revealing their own alternative to AppleScript at WWDC13), I realized this was a unique opportunity to turn things around. The JavaScriptOSA component at the second line, I wrote in less than a month and sent it to the Mac Automation team to learn from/steal however they liked. I even had the book outline for “Learn JavaScript for Automation” worked out, and good chance of getting Apress to publish it.
I’d have done all the community building and support—everything needed to make JXA successful, because I adore what Mac Automation technology has empowered me to do as both an end user and as professional developer. I was desperate to see that power shared with other users, so those users could empower themselves too—even as the Zucks and the rest were doing their damndest to lock all us in their gilded cages and nice little dependent revenue streams for themselves.
I gave Soghoian six weeks of world-expert consultancy in the runup to JXA’s release, and in return for all that he ghosted me with not even a “Thanks, but no thanks” for working my ass off to make him successful. Probably cos I was telling his work was crap—and how to fix it within weeks to be awesome—and not how the sun was shining out of his ass. Mr Jazz-Ego, ladies and gentlemen.
At least I had the sense to write off my losses and run.
…
There is a coda: Not too long after JXA immediately failed and sank without trace exactly the same as ScriptingBridge did 8 years before, Apple’s new Swift language was starting to rocket as the Hot New Platform in macOS development. And because I’m a glutton for self-inflicted pain, I wrote SwiftAutomation.framework for it, and then wrote Sal Soghoian offering to give it to his team outright. Simply tie it onto Swift’s coattails and ride that Swift rocket to mass market success.
Sal Soghoian, a natuarl charmer who for 20 years sat in the front seat row to the greatest Marketing and Sales Masterclass of a generation, arrogantly blew me off threw that third-and-final chance for success straight back in my face.
And in return for that, I wrote a no-holds-barred email explaining to him exactly how his incompetence and failure to learn had driven Mac Automation right into the ground. And just over a year later, Apple management, facing their first flat year in over a decade, did some long overdue dead-wood clearing, and the waste of a chair was finally sacked—though not before dragging his entire team, product, and users right down with him.
Mac Automation as Cook and Harris conceived it was an incredible thing. Apple management only made two mistakes:
1. Pissing off C&H by stealing half their team in order (as one wag memorably put it) to get OpenDoc ready to throw away; causing them to quit in disgust, taking all of the institutional knowledge, insight, and experience for making Mac Automation a popular success; and
2. Hiring Sal Soghoian, a charming enthusiastic fanboy with zero product development skills (and zero interest in learning) as their “replacement”.
If only Apple had hired Cal Simone or Mark Alldritt, who actually knew what they were doing and how to sell product. Or better yet, realized what visionary jewels they had in Cook and Harris, and bent over backwards to win them back. So it goes.
…
I’d say “AMA”, but I think that largely covers it. Yes I am salty AF; but I know what has been so incompetently and thoughtlessly lost. And some of that’s my bad, for blowing opportunities like cheap balloons, so mostly I’m just pissed at myself. But William Cook passed recently, which I am still sad about, and Warren Harris a few years before. Those guys and Bill Atkinson are my Tiny Gods, and as I line up for my next attempt to Make Things Better (3rd time’s the charm), I would not be me without them and their groundbreaking work.
Mad props, fellas; and whatever heaven you’re now in, may all your AppleScripts there compile and run forever. --has