![]() (I would link to the original session video but looks like Apple has memory-holed it.) That would’ve positioned JavaScript as a modern, developer-friendly alternative to the ancient, painful, and increasingly deprecated OSA. In fact, they did make a start on this, with the JavaScriptCore team announcing a new App-embeddable ObjC API at WWDC13. Remember, this was back around 2012–2013, when Node was just starting to take off. If you want to try nodeautomation, which I’ve recently rebuilt, you will need to install from my GitHub: I agree with Daniel: JXA was a huge mistake and Apple should’ve focused on quickly positioning WebKit’s JavaScript as a modern alternative to Node.js. SwiftAutomation I’ve not used in a while so I can’t vouch for that. The only “appscript” which I can say for sure still works is the Python3 version, which is available on PyPI. Here’s the old appscript page for reference: (I currently use these bridges with Adobe CC-based customers wanting to migrate their legacy AppleScript workflows onto modern supported technologies, although only as a temporary stepping stone: I can migrate their AppleScript code to Node.js + nodeautomation now and later, once Adobe finishes UXP, the legacy Apple event stuff can be replaced by shiny new UXP API calls.) Apple’s pram, Apple’s toys we’re all just visitors in it. So caveat emptor, E&OE, and don’t invest any more in it than you are willing to lose. If Apple change something in macOS that breaks it, it breaks. The macOS APIs these bridges depend upon are mostly legacy and some have been deprecated for years. The catch is: I will no longer provide (free) training or support, nor any warranty whatsoever. (Apple even considered bundling Python and Ruby appscript in 10.5 until some Apple manager spiked that in favor of their own in-house trash.) (There is also a 3rd-party fork of Ruby appscript, rb-scpt, but I don’t use that myself.) I know appscript is competent to replace AppleScript because I wrote it for that purpose and have been using it professionally for advanced automation development for more than a decade. Now, if you do enjoy living dangerously, there are technically competent alternatives to AppleScript: Python appscript and its descendants, SwiftAutomation and nodeautomation. A modernized Apple event architecture could’ve been ported to iOS by now and hooked into Siri, enabling direct voice control across thousands of apps: simple commands and queries spoken instead of typed. While the language support is dreadful, the underlying remote-query architecture is actually rather good: a very high-level user-oriented UI/UX that’s a full peer to GUI, only using words instead of click and touch. ![]() This is a huge pity and tragic missed opportunity. That’s partly why both of those products crashed and burned.Īlso important to note: Apple management eventually noticed these repeated failures too, finally disbanding the Mac Automation team and firing its Product Manager in 2016! The entire AppleScript stack has been in minimal maintenance mode ever since. it confuses the hell out of users when it does behave in profoundly non-OOP ways, as observed behaviors contradict their mental model. it breaks some features that work perfectly in AppleScript and 2. JXA and SB lie to their users, pretending app scripting it’s OOP when it’s not. JXA, like ScriptingBridge before it, makes a critical mistake: it failed to learn from the mistakes and successes of its predecessors. (Or perhaps XQuery over XML-RPC, except that is euI wish the original designers hadn’t tried to disguise the join: the impedance mismatch between the two is too great better to be honest about its true complexity than pretend that it’s simple by hiding that complexity from users, which only confuses and frustrates them and gives the product a bad reputation. Kinda like SQL, except you’re querying tree-shaped graphs instead of tables. It’s remote procedure calls plus simple first-class queries. The key to understanding application scripting in AppleScript is this: It is not OOP. AppleScript syntax is awful, but at least it works right and has some community support for when you get stuck. There’s a reason nobody uses it: it’s garbage. There are some JXA resources if you google around but, I wouldn’t bother.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |