How to do addition in maestro version 7

I’m trying to do something very simple:

I want to create a variable ‘x’ and set it to the value of 5. I want to add 5 to that variable, and then set the clipboard to this value.

I have a "Set Variable ‘x’ to Text ‘5’ action.
I then created a "Set Variable ‘x’ to Calculation ‘x+5’ action.

I’m trying to output the value of the variable ‘x’ to the System Clipboard but cannot figure that part out.

Guidance appreciated!

I believe I figured it out:

In order to reference the actual variable I need to enclose it with percent signs, so what I ended up with was:

Set Clipboard to Text ‘%x%’

One note, on keyboard maestro 7, when you click the “try” button it is NOT executing the full macro. It is only executing ONE SPECIFIC ACTION - the one you have highlighted. This tripped me up for a moment.

Try this:

Regarding the "try" button, it works on all selected actions. So you could select all actions before using it.

As an alternative, try this macro - I use it constantly:

1 Like

Great thank you.

Interesting that you used:


instead of just


. For me, the latter one worked. Why use the former?

The latter (%x%) is a short form, which will work fine right up until I add a token named x and then that will take precedence over your variable.

I probably wont ever make a token named “x” (well, I suppose it could have the current mouse X coordinate…), but generally the long form is preferred.

1 Like

Gotcha. Thanks again!