How can I convert a "wizard"-based macro to a script macro?

I.e., I use agent’s macro wizard to create a macro step-by-step. Now I want to combine two macros into one: e.g., I’ve got a macro for an unshifted key, and a macro for a shifted key, and I want them both on the same key. So clearly I need a macro script that has ifShift ... then an ifNotShift ... - but I don’t know how to convert from the wizard macros (as they appear in an exported configuration.json to script language.

(To me this isn’t trivial as the wizard-macro has 3 steps: a key tap, a text, and another key tap.)

BTW - Is it in fact clear I need to do this? Can I arrange, via the agent macro wizard, to have a particular key mapped with two macros - one for shifted and one for not shifted?

ifShift suppressMods {
    tapKey a
    write "Hello there"
    tapKey b
}
else {
    write "Good bye"
}

It is also possible to combine the gui actions with command actions via conditional jumps, but that can get messy.

2 Likes