Can a variable be placed into an Execute Shell Script action?

I have a shell script that I want a variable in.

The shell script is:

open --background 'one-thing:?text='

I want to put my variable in after the equals symbol.

The variable I want to put in is varToday.

Am I close with either of these?

open --background 'one-thing:?text=%Variable%varLink%'

open --background 'one-thing:?text=$KMVAR_varToday'

Hello Jim (@Jim) :wave:

It’s the second one

From the Wiki Pages:

Keyboard Maestro variables are included in the environment of the script, with the prefix KMVAR_ and spaces in the name replaced with underscores (_)

For more information on using Variables in Keyboard Maestro visit Execute a Shell Script - #Using Keyboard Maestro Variables.

Greetings from Germany


Thanks Nr.5-need_input

I tried:

open --background 'one-thing:?text=$KMVAR_varToday'

…and it idid not work.

So, I started experimenting with quotes.

This seems to work:

open --background 'one-thing:?text='"$KMVAR_varToday"''

Does anyone have any corrections to the quotes? Or advice on such?

If the text contained in the variable has for example spaces in it then the quotes are mandatory.


Thanks Taj

I could not tell @Jim better ....

@Jim read the wiki Page .... I've had it done just before answering here just to be sure....

Greetings from Germany