Replicate $PATH From Your Environment to Keyboard Maestro

Hey Folks,

Some folks struggle when they find out that the default $PATH from their environment is NOT replicated in Keyboard Maestro.

There's a simple way to work around this, and that is to add a variable named ENV_PATH to Keyboard Maestro and give it the same path you can find in your Terminal by using the command echo $PATH.

I have automated this process in the appended macro.



If using macOS Ventura or later you'll need to change “Preferences” to “Settings” in the Select or Show a Menu Item action in the macro.

Download: Make ENV_PATH Variable in Keyboard Maestro Using the Terminal v1.00.kmmacros (12 KB)

Macro Image



Hey Folks,

Here's a pretty painless way to to compare your macOS Terminal and Keyboard Maestro $PATH strings.

  • KM creates it's own environment for shell scripts it is often at variance with the Terminal environment.
  • The user is responsible for managing these differences.
  • Hopefully this tool will help with that.


Download: Compare Terminal & Keyboard Maestro $PATH Strings v1.00.kmmacros (14 KB)


Keyboard Maestro Export

  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 10.14.6
  • Keyboard Maestro v10.2


Greetings- Can you suggest how to revise this to work with zsh?

Try adding a zsh shebang line to the execute shell script action.

#!/usr/bin/env zsh

Let me know if that works.