Is there a good way to pass parameters to macros from the Trigger Macro By Name search box. For example, I’ve created a macro to start a countdown timer. If I type ‘timer 30’, then no results are found. So I can’t pass the duration to the macro.
To get around this I created a Comment action and added a bunch of numbers I want to use as duration to it. So now searching for ‘timer 30’ gives me the timer as the result and it will trigger the macro with the string as the parameter. Then I extract the number from TriggerValue using a regular expression. The method works for this example but obviously I can’t use it if the parameter space is too large. Such as a file name. I was thinking of using it sort of like Alfred.
Is there a better way or is this simply not possible with Keyboard Maestro?
That is basically finished except for doing whatever you want with the value. For example, you can use this macro, Trigger Macro by Name like "timer 10", it will pause ten seconds and then speak the specified text. The Comment is just so the numeric values (eg 10) still matches.
Based on your work, I have extended it in this macro, which shows the results of the trigger, and validates the “parameter” typed at the end of the macro name: