Unselect Initial search text in Trigger Macro by Name

I'm trying to shape the Trigger Macro by Name to something that suits my usual keyboard workflow.
I'd like to launch the macro with an initial search text n: so that I can type the macro name to filter by, but the problem is that the initial text is selected when I invoke the action and thus I have to press the right arrow to actually start typing.
Is it possible to execute that action with the text unselected?
Alternatively, is it possible to execute that action with no text at all? (If I leave the Initial search blank, it usually shows the string typed the last time I invoked the action)

Thanks in advance,

PS: I know that I could probably reach something similar using palettes, but I would like to freely type text rather than relying on the letters suggested by palettes.

PPS: I'm also aware of the awesome "Execute Macro by Name (Spotlight)" but I'm still trying to figure out my best way to do this kind of stuff and thus I'd like to have more control over filtering, parameters etc

Hey Francesco,

You can always type e or f to move the cursor manually.

But if you want to do it automatically you'll have to do something like this.

Create a sub-macro:

Trigger Macro by Name Helper.kmmacros (2.2 KB)

(You'll have to dig into the Keyboard Maestro Editor package to find the Keyboard Maestro Engine. See: Finding the KME in the Finder)

Run the sub-macro asynchronously from your main macro before the Trigger Macro by Name action.

Trigger Macro By Name.kmmacros (1.7 KB)

After that you're in business.


Awesome! Thank you @ccstone!

1 Like

Thanks for this trick. It worked like a charm!

I would like to add some extra instructions, because I wasn't sure how to do it when you said "You'll have to dig into the Keyboard Maestro Editor package to find the Keyboard Maestro Engine". So to anyone interested (or maybe you can add this to your own reply):

When adding the Pause action and picking the "The front window of" option, it will show "Front Window" by default. Click that and pick "Other...". It will open the window to pick your app. Leave it open.

Go to Finder > Applications. Right-click the Keyboard Maestro application > Show Package Contents > Contents > MacOS. Inside this folder you will find the Keyboard Maestro Engine application.

Now you have 2 options:
1 - Make both Finder and Keyboard Maestro Editor sit side by side
2 - Click and hold Keyboard Maestro Engine, press CMD+Tab to cycle through the open apps until you have Keyboard Maestro selected

All you have to do is drag and drop Keyboard Maestro Engine to the window that was left open after clicking "Other..."
This will select Keyboard Maestro Engine as the Front Window option.

I've added a link to this in my post that you refer to.

Finding the Keyboard Maestro Engine in the Finder

1 Like

Thanks for sharing that!

1 Like