(Old) Issue with Shell, still can't figure out why this isn't working

Terminal:
/opt/local/bin/ffmpeg

Keyboard Maestro
Shows the same path, but I had to set it to "Include All Variables", otherwise it would show me this in the Engine.log:
Task failed with status 1

Why is that, if I'm not using KM variables? :thinking:

If I run this in Terminal, it works (without adding the full path):
ffmpeg -i song.wav -vn -ar 44100 -ac 2 -b:a 192k song.mp3

If I run the exact same command in Keyboard Maestro set to "Include All Variables", it also works.

But if I set to "Include No Variables" I get this:
Action 16240720 failed: Execute a Shell Script failed with script error: text-script: line 1: ffmpeg: command not found

You are not using ENV_PATH ?


Execute a Shell Script :: ENV_PATH [Keyboard Maestro Wiki]


If you set a blanket "Include No Variables", without checking any exceptions in the list below, then your environment definition collapses because you have hidden the Keyboard Maestro variable ENV_PATH.

If you want no other KM variables in the shell environment, then the trick is to check just ENV_PATH for inclusion.

2 Likes

Oh you're right, I wasn't thinking about the ENV_PATH.
I just included it and it's now working! :slight_smile:
I will change my shell action that's saved as favorite to include this.
Really appreciate your help on this! :raised_hands:

1 Like

Nice catch, @ComplexPoint -- the tester here does, of course, "Include All Variables".

One to remember for the future...

2 Likes

I wonder whether @peternlewis (or any other Wiki maintainers) feel that the Wiki section which says that:

Once the ENV_PATH variable is set, it will remain in your Keyboard Maestro variable until/unless you delete it, and remain available to every Execute a Shell Script action that you might use in the future.

(See: Path in Shell Script)

might benefit from a caveat about the Include No Variables option
(in Execute Shell Script) actions ?

Done.

2 Likes