2023-11-03 21:53:11 Action 15299640 failed: Execute a Shell Script failed with script error: Traceback (most recent call last):
File "/opt/anaconda3/bin/ffmpeg-normalize", line 8, in
sys.exit(main())
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/main.py", line 496, in main
ffmpeg_normalize = FFmpegNormalize(
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 116, in init
self.ffmpeg_exe = get_ffmpeg_exe()
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/_cmd_utils.py", line 171, in get_ffmpeg_exe
raise FFmpegNormalizeError(
ffmpeg_normalize._errors.FFmpegNormalizeError: Could not find ffmpeg in your $PATH or $FFMPEG_PATH. Please install ffmpeg from http://ffmpeg.org
2023-11-03 21:53:11 Execute a Shell Script failed with script error: Traceback (most recent call last):
File "/opt/anaconda3/bin/ffmpeg-normalize", line 8, in
sys.exit(main())
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/main.py", line 496, in main
ffmpeg_normalize = FFmpegNormalize(
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/_ffmpeg_normalize.py", line 116, in init
self.ffmpeg_exe = get_ffmpeg_exe()
File "/opt/anaconda3/lib/python3.9/site-packages/ffmpeg_normalize/_cmd_utils.py", line 171, in get_ffmpeg_exe
raise FFmpegNormalizeError(
ffmpeg_normalize._errors.FFmpegNormalizeError: Could not find ffmpeg in your $PATH or $FFMPEG_PATH. Please install ffmpeg from http://ffmpeg.org. Macro “Normalize MP3 -1dB (available via Raycast) FINAL” cancelled (while executing Execute Shell Script).
Any idea what's happening?
This is the action and that's all I have for that macro
For starters, fix the unmatched double quotes in your KM action. Umm, sorry, there was a pop up symbol that was hiding your second double quote. Let me try again. Here's what I saw. You can see why I didn't notice the second quote...
Why did you specify a full path name in the KM action for the program name? Can you try it without the pathname? I'm worried that you may be choosing a different program.
I'm also worried that the environment doesn't match. You may have specified some environment variables in your open Terminal that you didn't specify in your fie that sets up your environment variables for your default Terminal. I'd say that's the most likely culprit.
The way you specified the output file "$KMVAR_Local__mp3 - normalized" might be interpreted as two separate arguments because of the space. You may need to enclose the entire output filename in quotes or use an escape character, hence the suggestion above.
The original script (which was for another macro and I was just using ffmpeg, without the -normalize) was without the path and wasn't working then someone here on the forum suggested using it and it worked.
If I try it without, I get this:
2023-11-03 22:13:22 Action 15299669 failed: Execute a Shell Script failed with script error: text-script: line 1: ffmpeg-normalize: command not found
2023-11-03 22:13:22 Execute a Shell Script failed with script error: text-script: line 1: ffmpeg-normalize: command not found. Macro “Normalize MP3 -1dB (available via Raycast)” cancelled (while executing Execute Shell Script).
Then my theory about a path problem (one of your environment variables) is probably correct. You need to look at your path in your open Terminal and see what it is for your spawned terminals.
Do you know how to check your path for both cases?
Step 1. In your open window enter the command: env, and make a close note of your long PATH variable.
Step 2: Run this:
Step 3: compare the two results, character by character. I suspect the difference is your problem.
In the very first sentence of your post, you wrote "if I try this in Terminal." That's the window that I want you to type "env" in, or maybe better, "env | grep PATH".
And "close" is a homonym and may be the reason it was misunderstood. I'll figure out how to reword it.
Can you create and run the Execute Shell Script action above, and consider posting the result here?
The reason I'm pursuing this line of thought is that there's a chance you set up a variable in your open Terminal without knowing that that's required for your program to run, and it hasn't been set up correctly in your environment set file which KM uses to run the shell script.
There's far more to making a program work than getting its path correct! There are often library paths that need to be in the path too. That's why I'm having you check. Sometimes there are other ENV variables also, which we haven't checked yet.