I'm trying to encase the selected text into a full Keyboard Maestro style variable token and then paste it.
For example, if the text "MyVariable" is selected and the macro is triggered, it should be become "%Variable%MyVariable%".
EncaseTextInVariableToken.kmmacros (3.2 KB)
The problem I'm getting is that it only works part of the time. Sometimes it only pastes the selected text (instead of that same selected text encased in a variable).
Could this be from some sort of delay when using the clipboard? If so, inserting pauses doesn't always guarantee I'll get the desired result.
What's going on and/or is there a better way to accomplish this?