UNPKG

itunes-bridge

Version:

A macOS and Windows NodeJS package to control and get informations from iTunes and macOS Music app through AppleScript

29 lines (25 loc) 513 B
let iTunes; try{ a.doShellScript("open -Ra Music"); iTunes = Application('Music'); }catch{ iTunes = Application('iTunes'); } ObjC.import('Foundation'); const argv = $.NSProcessInfo.processInfo.arguments.js; function run(argv) { switch (argv[0]) { case "play": { iTunes.play(); break; } case "pause": { iTunes.pause(); break; } case "stop": { iTunes.stop(); break; } } }