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.

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%.

I really like that. Will start using immediately.

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.

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.

Yes, there are never underscores in token names either.