4 ms·
If you really want to script macOS apps using JavaScript, try nodeautomation: https://www.npmjs.com/package/nodeautomation https://www.npmjs.com/package/nodeau
by hhas 4y ago
If you really want to script macOS apps using JavaScript, try nodeautomation:
https://www.npmjs.com/package/nodeautomation https://www.npmjs.com/package/nodeautomation
JXA is buggy and crippled, with abysmal documentation and zero community or official support.
nodeautomation is provided without warranty or [unpaid] support, but at least it works right and I will keep maintaining it for as long as I use it myself (maybe 3-5 years, as it’s part of my AppleScript-to-UXP migration toolkit for Adobe CC scripters).
If you can run[1] the ASDictionary and ASTranslate support apps they answer 95% of “How do I…?” questions for you.
That all said, you really are best sticking to AppleScript. The language sucks and its community moribund, but at least there are people there who understand how to use it with the various “AppleScriptable” apps who can help you when you get stuck.
--
[1] Both apps are written in Python3 and py2app, and I haven’t bothered to codesign those releases (it’s a chore) so M1/M2 Macs will probably refuse to run them. (If anyone really cares, they can jump up and down on me to do so or, even better, codesign them for me so I can just post those builds.)