Shell command working in Terminal but not in Keyboard Maestro

Hello,

I'm trying to use Video Contact Sheet (VCS) through Keyboard Maestro.

The following command runs smoothly in the Terminal:

vcs /Users/username/Desktop/video.mp4 -U0 -i 15s -c 3 -H 200 -a 300/200 -o /Users/username/Desktop/contactsheet.jpg

But executed through Keyboard Maestro, I receive the following error:

Execute a Shell Script failed with script error: stty: stdin isn't a terminal tput: No value for $TERM and no -T specified.

Any help?

TIA

See, for example:

Get "Execute a shell script" working - Questions & Suggestions - Keyboard Maestro Discourse

None of the paths or other environment variables defined in the Terminal.app shell are seen in the fresh vanilla shell provided by an Execute Shell Script action.

Your first step may be to find the full path to vcs, with an incantation like which vcs.

It is basically telling you that the script, when run from Keyboard Maestro, has no terminal for stdin, and apparently the vcs command wants one. Presumably vcs wants to be able to ask you for some input (or might want to?) and is using tput to do that and there is no way to input because there is no “terminal” (ie, no keyboard input) to the command when run as a script in Keyboard Maestro.

Does the command ask you for additional information when run in the Terminal? If so, you’ll need to figure out how to avoid that. If not, you’ll have to figure out how to tell it to run in a non-interactive mode.

Does the command ask you for additional information when run in the Terminal?

No, nothing asked.

OK, well, basically it is wanting the input to be an interactive terminal for some reason and that needs to be dealt with.

You could just try setting the TERM variable to something in the action, something like

TERM=dumb vcs…

But given I don't know why it wants to know about the Terminal, it's hard to say what the command is doing.

3 Likes

THANK YOU Peter! The TERM variable solves the issue! Thanks again!

Have a nice day :sunny:

3 Likes

@carycrusiau can you share your shell macro ? I'm also interested by scripting vcs but I got the same error. I've try this with no success: TERM=dumb /opt/homebrew/bin/vcs /Users/mcmini/Downloads/file_example_MP4_1920_18MG.mp4 -U0 -i 1s -c 3 -H 200 -a 300/200 -t5 -o /Users/mcmini/Desktop/contactsheet.jpg

Also if your are interested I've done a macro doing a contact sheet but using only ffmpeg and keyboard maestro.

1 Like

Sure!

This command is working for me:

Also if your are interested I've done a macro doing a contact sheet but using only ffmpeg and keyboard maestro.

Thanks but, in fact, I discovered VCS by following this tutorial:

So I also have a command to create a contact sheet with FFmpeg and ImageMagick. But VCS is simpler and more complete.

1 Like

Thanks a lot ! First didn't worked but helped me to undertstand that I had a wrong ENV_PATH setup.
Found how to setup it properly with this post
Now it works.
Hopefully it will helps someone else.
Great app, people and forum :slight_smile:

1 Like