It looks like you're new here. If you want to get involved, click one of these buttons!
Macro.add('MySugarCubeMacro', { handler: function() { console.log ("MySugarcubeMacro() invoked!"); } }); window.macro_invoker = function() { // i have no clue how you do this... Macro.Invoke("MySugarCubeMacro"); }
Comments
There are other ways too, but that's the one I've seen most often recommended, and the one I usually use.
E.g.
Because macro definition is basically just a thin abstraction layer around Javascript code evocation and using <jQuery>.wiki (or a Wikifier) in this case to evoke the same code from two locations is an expensive operation.
On the other hand it is very unlikely that anyone but yourself is going to add new properties to the setup object, which SugarCube supplies for the Author's use.