Switch Audio Source

Hey Ali,

The typical place to install 3rd party Unix executables is here:

/usr/local/bin/

Open a window in the Finder, type Cmd-Shift-G, and paste the path into the “Go to the folder” field.

The system will require you to authenticate the move, and that's fine.

Also – there is no point in running a shell script from an AppleScript, unless it's part of a larger AppleScript.

Keyboard Maestro has a Execute a Shell Script action for pure shell scripts.

image

See this topic on the wiki for more information:

https://wiki.keyboardmaestro.com/action/Execute_a_Shell_Script

By using the export command, with the PATH variable, you won't have to use the full path to the executable.

export PATH=/usr/local/bin:$PATH;
AudioSwitcher -a

See brief discussion here: Path to excutables in shell scripts

You can also set a variable in Keyboard Maestro's variable preferences that will globally affect the PATH environment variable in the KM context.

The following link is to a macro that will do that for you.

Create a PATH Environment Variable for Keyboard Maestro and Add /usr/local/bin to the Default Path

This allows you to call your shell executable very simply:

AudioSwitcher -a

-Chris