This works for me, so I do not need to specify the path to each executable.
I install most of my cli-tools with HomeBrew and they are often saved under version number. So before I knew this trick I had to update KM-macros each time there was an update.
Note that new in 7.0, you can set the variable “ENV_PATH” to “/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin” (or whatever) and Keyboard Maestro will set the PATH environment variable to that value when it runs any script. Same for “ENV_Anything”.
The variable needs to be named “ENV_PATH” (ie, ENV<underscore>PATH). I’ve used spaces when documenting this elsewhere but that is unintentional and wrong, but needs to be an underscore.
Did I miss something?
How can I echo the values of global variables inside KM scripts? I tried to simply
echo %VARIABLE%ENV_PUSHOVER_TOKEN%
and
echo %VARIABLE%PUSHOVER_TOKEN%
but don't get any value for those variables.
Lastly I tried to enter the values manually. Like
pushover -t XXXXX -u YYYYY "My Message"
but still got the same frustrating
"Error: Missing required field: token"
I'm about to give up and look for other automation / scripting solutions
When in doubt, simply execute the command “env” and display the results in a window, and then you can see all the environment variables as the command will see them.