Hey Folks,
Did you know that Keyboard Maestro by default only sees a very few of the Unix executables on your system?
So under normal circumstances you may have to call an exe by its full path in an Execute a Shell Script action like this:
/usr/local/bin/AudioSwitcher -a
That's cumbersome and hard to read.
It's much nicer to be able to write (and read):
AudioSwitcher -a
Fortunately Peter has allowed us a means to set Keyboard Maestro's shell environment variables – see the Execute a Shell Script section of the wiki for more information.
The appended macro will add the /usr/local/bin/
directory to Keyboard Maestro's PATH variable, and it will be stored in ENV_PATH
. You can see this in Keyboard Maestro's preferences' variable panel.
If you already have customized your ENV_PATH
variable the macro will exit and leave it alone.
If you use the MacPorts package manager for Unix executables you might want to use this command, instead of the one in the macro. It will add the MacPorts directories and the /usr/local/bin/
directory.
echo opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH;
Since this alters your Keyboard Maestro environment I've left off a trigger. The easiest way to run it in Keyboard Maestro 8 is with Cmd-Shift-R in the editor.
Macro Image
If somehow you manage to screw things up you can just delete the variable ENV_PATH
from Keyboard Maestro's preferences' variable panel and start over.
-Chris