You can do the same thing natively in Keyboard Maestro by using the Filter Variable action to process the text tokens a second time. Note that you have to carefully double the percentage signs (%) so that only the variable is expanded in the first case.
Keyboard Maestro Actions.kmactions (1.2 KB)