Tokens Missing in KM Editor UI

Tokens Missing in KM Editor UI

@peternlewis, it appears that the following Tokens are missing from the KM Editor.
I can't find them in either the menu or the Insert Token by Name popup.
Running Keyboard Maestro 8.2.1 (8.2.1) on macOS 10.12.6.

image

Hey Peter,

Speaking of “tokens” – the Insert Variable by Name command does not properly escape variables inserted into text fields.

It would be nice if it did – OR if Option-Click or Option-Return would toggle between plain and escaped versions.

-Chris

I have added a Characters section for them in the editor.

Fixed in Keyboard Maestro 8.2.2 update.

1 Like

I can see the utility of it doing this in some circumstances, but it is probably not practical to do.

One thing I did notice recently, if you use Local variables, then it is much clearer and safer to use the short form of variable reference in tokens, eg, %Local MyVar%.

1 Like

I really like that. Will start using immediately.

1 Like

Hey Peter,

That is definitely a cleaner representation, but why safer?

-Chris

Because %Local Var% will never clash with a built in text token which never have spaces in them.

1 Like

Given that, then I'd assume that %Local__Var% should be just as safe.
I like to use the "Local__" (with two underscores) because:

  1. When used in a Prompt for User Input, only the root "Var" shows.
  2. When I double-click the var name, the entire name is selected.
    • Else you have to go to much more effort to select the entire %Local Var%.
  3. It improves readability. Else, is "Local" part of the name, or is it a keyword/command?
  4. It is way too unnatural for me to use spaces in a variable name. Don't know of any other common languages that support this.

All of the above applies to "Instance" variables as well.

1 Like

Yes, there are never underscores in token names either.

2 Likes