3 ms·
> AppleScript is a HORRIBLE language. Agreed. > But it never worked that well in reality. Disagreed. As bad as the AppleScript syntax is, it’s the only way t
by latexr 4y ago
> AppleScript is a HORRIBLE language.
Agreed.
> But it never worked that well in reality.
Disagreed. As bad as the AppleScript syntax is, it’s the only way to automate certain things in macOS and it generally does it competently. Plus it has an Objective-C bridge, allowing you to run lower-level commands from a scripting language.¹
> with all big and important apps being Electron
Chromium itself (and all major browsers derived from it) has a fantastic AppleScript dictionary which is even better than Safari’s.² Firefox is the single major browser without AppleScript support. Plenty of apps still include an AppleScript dictionary and Electron has an open issue for it.³
> I never knew that it works with JavaScript.
It was added in Yosemite.⁴ It’s not perfect and has some bugs compared to AppleScript, but it also makes other things significantly easier or possible, such as dealing with JSON.
¹ Technically one can use Swift as a scripting language too, but it requires installing the Developer Tools.
² Quick example: one can’t open a new private Safari window via AppleScript, except by scripting the GUI.
³ https://github.com/electron/electron/issues/4418 https://github.com/electron/electron/issues/4418
⁴ https://developer.apple.com/library/archive/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/OSX10-10.html https://developer.apple.com/library/archive/releasenotes/Int...