Possible bug in Execute Shell Script Action

Hey John,

There's not a bug in the Execute a Shell Script action. You just need to understand how to use Keyboard Maestro variables properly within one.

No bug in execute shell script.kmmacros (2.2 KB)

See the Execute Shell Script section of the wiki.

A variable in a text field is properly denoted by: %Variable%pathName%

But that does not work in an Execute a Shell Script action – $KMVAR_pathName is the proper format.

And to manage spaces within such a variable you need to double-quote it:

"$KMVAR_pathName"

You have to properly manage spaces in paths within do shell script commands in AppleScript too, and the best method is to use quoted form of.

do shell script "open -t " & quoted form of pathname

-Chris

2 Likes