Skip to content

Passing arguments with Util.command() not working as expected #30

@hhartkopf

Description

@hhartkopf

Hi, first of all thank you for this nice little tool. I'm currently trying to control the output volume of a Mac by using the switches on my MIDI keyboard. I'm using this command: receivemidi quiet dev "V25 Out" jsf AdjustVolume.js and the AdjustVolume.js script looks like this:

if (MIDI.getControllerNumber() == 49 && MIDI.getControllerValue() == 127)
{
    Util.command('AdjustVolume --increment --device-name "Built-in Line Output"');
}
else if (MIDI.getControllerNumber() == 48 && MIDI.getControllerValue() == 127)
{
    Util.command('AdjustVolume --decrement --device-name "Built-in Line Output"');
}

The AdjustVolume command comes from https://github.com/jonomuller/device-volume-adjuster and is working fine in a regular shell but invoked by the script it throws Device name not found. so i guess the device name argument is not passed correctly. I already tried swapping the single and double quotes and some other things like escaping the quotes but i could not get it to work. I'm not an expert in JavaScript or C++ so am i missing something obvious here or how is Util.command() supposed to be used?

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