Can i use a Variable within a Variable [Dynamic Variable Name] to paste a text?

My goal is to paste the contens of a certain variable. The variable-number is given by the user.

I succeeded in setting the variable using this:

First action:

I ask the user for to set the variable markernumber
Example: the users enters: "100"

Second action:

Then i store the contends of the current clipboard in the variable called markermarkernumber
As markernumber is "100" the contends of the clipboard will be stored in variable marker100

But i cannot recall in the same way as above:

When i recall _marker100_it does work.
But not when i recall marker%variable%markernumber%

What am i doing wrong, or is there another method to achieve this?

(gee, i have a hard time explaining this...)

You are close, but it is confusing. To use a KM Variable whose name is dynamically determined in the Macro, it requires two steps:

  1. Set a Variable to the variable token (computed name) you want to use:
  2. Use a KM Filter Action to process that Variable to "Process Tokens" to Get the Actual Data

So now that variable can be used for output, like in your Insert Text by Pasting:

Here's an example Macro that demos this process.
Please feel free to ask any questions.

MACRO:   Use Dynamic Variable Names [Example]

~~~ VER: 1.0    2018-03-07 ~~~


Use Dynamic Variable Names [Example].kmmacros (6.8 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.



Wow, thanks a lot!
After some fiddling around, i think i have managed! Just what i needed!

But it does bring up an second question. (that’s how it goes huh!)

I want to display a notification with a list of all the contends of variables that are all called
marker n
where n could be any character.



But i cannot use a wildcard * can i?

How would i do that?

For this use case, you may be better of using KM Dictionaries (KM Wiki).