Open yunyu opened 6 years ago
To me, this looks like https://github.com/wtfaremyinitials/osa2/blob/master/index.js#L6 outputting ES6, which is presumably not supported by osascript. It looks like changing all the arrow functions to function ()
(and possibly changing all of the osa() functions to ES5) would fix it.
Alternatively, using the Babel API in osa2 would also fix it: https://github.com/yunyu/osa2/commit/38bdc2cd346836f553891305205499b22751f97d
The module works as-is on macOS 10.13, so I guess ES6 was added to osascript
recently. I like the babel solution; if you PR it I'd be more than happy to merge it.
When running this script:
I get this output in the terminal:
I am running Node v8.9.4 and OS X 10.11.6.