Skip to content

Command failed: osascript #46

@scstraus

Description

@scstraus

I'm getting the below error when trying to turn speakers on and off on iTunes 12.10. Any idea why?

'[2020-10-22T16:23:57.649Z] - ::ffff:10.10.10.20 - PUT /airplay_devices/40-3c-fc-05-7f-38/off 200 123.164 ms - 207b'
Error: Command failed: osascript -l JavaScript -e 'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function (id, selected){    itunes = Application('\''iTunes'\'');    id = id.replace(/-/g, '\'':'\'');    foundAirPlayDevice = null;    deviceData = {};    airPlayDevices = itunes.airplayDevices();    for (i = 0; i < airPlayDevices.length; i++) {      airPlayDevice = airPlayDevices[i];      if (airPlayDevice.networkAddress() == id || airPlayDevice.name() == id) {        foundAirPlayDevice = airPlayDevice;        break;      }    }    if (foundAirPlayDevice) {      foundAirPlayDevice.selected = selected;      if (foundAirPlayDevice.networkAddress()) {        deviceData["id"] = foundAirPlayDevice.networkAddress().replace(/:/g, '\''-'\'');      } else {        deviceData["id"] = foundAirPlayDevice.name();      }      deviceData["name"] = foundAirPlayDevice.name();      deviceData["kind"] = foundAirPlayDevice.kind();      deviceData["active"] = foundAirPlayDevice.active();      deviceData["selected"] = foundAirPlayDevice.selected();      deviceData["sound_volume"] = foundAirPlayDevice.soundVolume();      deviceData["supports_video"] = foundAirPlayDevice.supportsVideo();      deviceData["supports_audio"] = foundAirPlayDevice.supportsAudio();      deviceData["network_address"] = foundAirPlayDevice.networkAddress();    }    return deviceData;  })("Computer",false));'
0:1496: execution error: Error on line 1: Error: Parameter error. (-50)

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: `osascript -l JavaScript -e 'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function (id, selected){    itunes = Application('\\''iTunes'\\'');    id = id.replace(/-/g, '\\'':'\\'');    foundAirPlayDevice = null;    deviceData = {};    airPlayDevices = itunes.airplayDevices();    for (i = 0; i < airPlayDevices.length; i++) {      airPlayDevice = airPlayDevices[i];      if (airPlayDevice.networkAddress() == id || airPlayDevice.name() == id) {        foundAirPlayDevice = airPlayDevice;        break;      }    }    if (foundAirPlayDevice) {      foundAirPlayDevice.selected = selected;      if (foundAirPlayDevice.networkAddress()) {        deviceData["id"] = foundAirPlayDevice.networkAddress().replace(/:/g, '\\''-'\\'');      } else {        deviceData["id"] = foundAirPlayDevice.name();      }      deviceData["name"] = foundAirPlayDevice.name();      deviceData["kind"] = foundAirPlayDevice.kind();      deviceData["active"] = foundAirPlayDevice.active();      deviceData["selected"] = foundAirPlayDevice.selected();      deviceData["sound_volume"] = foundAirPlayDevice.soundVolume();      deviceData["supports_video"] = foundAirPlayDevice.supportsVideo();      deviceData["supports_audio"] = foundAirPlayDevice.supportsAudio();      deviceData["network_address"] = foundAirPlayDevice.networkAddress();    }    return deviceData;  })("Computer",false));'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions