Execute Macro Action: 2 suggestions

Execute Macro Action is a lever to KM development and help to organize his code.

● At present only one optional parameter can be given to a KM macro

Although it can be simulated some way, it should be nice to have more native optional parameters.

● It should be very nice to have a "Navigate to macro source" item, in the gear menu, to navigate directly to the called macro, as an elegant mean to inspect / improve its code.

Thanks,
-- Alain

Currently, the only way a macro has to know what triggered it is the %TriggerValue% token, hence there is only one parameter. To do more than one parameter, I would need to come up with some way to have more than one value accessible. It would also add complexity to the Execute Macro action.

It’s possible I will one day do this, but it needs some serious thought as to how best to do it in a way that integrates well with the rest of Keyboard Maestro.

You can, of course, simulate it as you described, using some sort of separator (comma would be fine if you knew that you would never have commas in the parameter values, or something less common like a bullet (•) character). Then just set a variable to the TriggerValue token and then Search Variable to break it apart.

Direct support for multiple parameters would be easier than this, but not a whole lot easier, so it needs to be done well and cleanly otherwise it really doesn’t add enough value.

And yes, there absolutely should be some way to navigate directly to the target macro - that is definitely on the todo list.

1 Like