Variable not sticking?


I have a very useful macro that I only use once a year, so I find it fails only rarely. I am trying to copy contents into a few variables and then use the variables later in the macro. This kind of thing:

Type the ⌘C Keystroke
Set Variable “Arrow1_START” to Text “%CurrentClipboard%”
Type the ⌘C Keystroke
Set Variable “Arrow1_LENGTH” to Text “%CurrentClipboard%”

These seem to work (the grey notice at the bottom of the “Set Variable” action shows the content of the current clipboard), but pasting into another application give the results: “No Text in Clipboard”:

Activate BBEdit
Insert Text “%Variable%Arrow1_START%” by Pasting
Insert Text “%Variable%Arrow1_LENGTH%” by Pasting

What changed or what am I doing wrong?

Thanks, Stan

After it fails, check the values of the variables (in the Keyboard Maestro preferences window, Variables pane).

If they look ok, then it may be an issue with the target application caching the clipboard (details). But BBEdit should generally be ok.

You could also try as a test adding some other characters to the Insert Text by Pasting so you can see if it is just that the variable (or token) is empty, or if something else is going on.

You could also check the Keyboard Maestro clipboard history to see what Keyboard Maestro thinks the clipboard looks like.