Why doesn't Insert Variables by Name not post full variables?

If I search for variable temp like here :

It will insert temp and not %temp%. I think the latter is preferred. For me at least.

Thank you.

I think this is working as designed.

What you are calling "full variables" is just one of at least three different notations/formats for variables:

A: The normal, naked format
B: The wrapped, tokenized format
C: The format for the shell

The way Insert Variable by Name is working allows you to use it for A and B and, if there aren't any spaces, also for C.

If Insert Variable by Name were always filling in the tokenized form (B), as you are proposing, then it would be pretty annoying in cases A and C.

So, I guess, it's OK as it is.

Do yourself a favor and use text expansion for cases B and C.

Here two example macros for that:

###For the tokenized format:

[demo] KM Var as Token.kmmacros (1.7 KB)

###For the shell:

[demo] KM Var for the Shell.kmmacros (1.7 KB)

This will create the wrapper for the variable and place the cursor at the position where the variable goes. You can then paste from the clipboard or use Insert Variable by Name to place the variable.

Of course you can do this also with other snippet expanders like Typinator, LaunchBar, etc.


Thanks, @Tom. Great macros.

Inspired by your maros, and building on them, here's my version which add the Insert Variable by Name, so that I only need one keystroke to insert a var.

If you don't want the Insert Variable popup, just press ESC twice.

I really like how the new KM8 Insert Variable by Name works, remembering your last selection. Since is almost always have a variable prefix, I can simply type the prefix and see all of the variables for this macro.

##Macro Library   Insert KM Variable Token Format

<a class="attachment" href="/uploads/default/original/2X/5/56aecc235d010a5ab19080a6ec871269508d1ca8.kmmacros">Insert KM Variable Token Format.kmmacros</a> (3.9 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


<img src="/uploads/default/original/2X/9/9483577bbd817de0bc4627e14ce160a4b86bc7e9.png" width="523" height="786">
1 Like

Yeah, basically that's the way LaunchBar works for a decade or more. I'm also glad to see it has made its way to KM :wink: