Learning about environment and KMVAR_ variables

Hi,
I am trying to learn about using environment and KMVAR_ variables. I am bit confused about environment variables - KMVAR_ and how to use them.

I see execute shell script...
env

but I bit confused how best to use them..

I tried...

if the variable
KMVAR_computerName
contains
"my computer"

also tried...

this environment variable
KMVAR_computerName
contains
"my computer"

but these didn't work

but this did work...

this environment variable
USER
contains
"Dave"

Is there a list of all of them and Docs how to best use them?

In the KM application under the 'Help' menu you can select "Keyboard Maestro User Manual"
When there - search on 'Variables'

This should get you started.

1 Like

These are things available within an "Execute Shell Script" action, not for use in "normal" KM actions.

Simplistically -- environment variables are the "preferences" for your shell, things like default user, where to look for things, language settings... KMVAR_ variables are representations of your already-defined KM variables -- if you have a KM action that sets the variable "myVar" you can then access the value in the shell script using $KMVAR_myVar -- which you can read from but not write to in an "Execute Shell Script" action.

If you aren't using shell scripts, you don't need to know about them. If you are then the place to start is the "Execute a Shell Script" action page on the Wiki.

1 Like

Thanks Steve_E & Nige_S for the info