3 ms·
JavaScript can do whatever the environment lets it do. Obviously browser based JavaScript is extremely limited but JavaScript running outside of a browser (e.g.
by adrianmalacoda 10y ago
JavaScript can do whatever the environment lets it do. Obviously browser based JavaScript is extremely limited but JavaScript running outside of a browser (e.g. on a server, or in a desktop application) can and does do all of those things you say it can't do.
It's been a long time since I've ever done any AppleScript so I can't really compare, but it does seem like the JXA environment can do any of those things, since it has an Objective-C bridge[0].
[0] https://developer.apple.com/library/content/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/OSX10-10.html#//apple_ref/doc/uid/TP40014508-CH109-SW1 https://developer.apple.com/library/content/releasenotes/Int...