Trigger Macro by Name - Limit to Smart Group Results?

I cannot duplicate this.

Are you sure something else is not going on?

Any other macros being triggered?

I just checked with the Debugger and no other macros are being triggered. There's no reason they would be, particularly as I'm triggering it using the Run button. It's a mystery.

Upon further investigation, I've found that the error isn't restricted to Smart Groups. Something's defintely gone squiffy because this wasn't happening two days ago. Is there some preference file I can trash to get things back to default behaviour?

CleanShot 2022-10-25 at 14.26.44

What happens if you put something in the initial search.

And is any other macro triggering? Is something typing the "ap:" for you?

:point_up:t3:

No.

That works fine.

Weird, isn't it! The Halloween gremlins have shown up a few days early.

Beats me. Relaunch the Keyboard Maestro Engine or restart?

Engine restart didn't work but a restart did it. I feel a bit sheepish for not having tried that already. :sheep:

Thanks!

That is really weird, so I have got no idea what was going on.

1 Like

One further question, if you don't mind...

If I search for "applescript" in my global list, it returns all macros that contain an Execute an AppleScript action:

What I'd like it to do is return only results whose titles contains the search term. Is that possible?

See: Search Strings user manual section.

The main purpose of this thread was to try to avoid typing search qualifiers, but I suppose that's not really possible. Darnit. Thanks all the same.

Use initial search terms to create your filter.

Then use a sub-macro to run asynchronously and wait for the Keyboard Maestro TMN dialog to appear.

Then have KM type Cmd-Right-Arrow (or Ctrl-E) and a space.

That sets you up to type without wiping out your initial filter.

It seems to me that @DanThomas has a TMN helper macro that takes a parameter to do this, but I'm not sure I remember correctly.

That was suggested earlier by @Frankb and seems like a decent solution. It would be nice if you could set the search criteria as part of the action and then forget about it, but hey ho. Thanks to you and everyone else for the advice and ideas. :+1:t3:

Huh? You can...

Trigger Macro by Name Example v1.00.kmmacros (1.5 KB)
Keyboard Maestro Export

Sorry, that was poorly worded on my part. I meant, without the search string appearing in the prompt, or having to create an async macro to move to the right of it.

1 Like

You could always lobby Peter to add a switch to the TMbN action that leaves the cursor at the end of the search string instead of selecting it.

I'm 99% sure that he won't do the invisible search-string thing though.

Ok here goes:

@peternlewis, I may be wrong, but I can imagine the most common use of the Trigger Macro by Name action is to type the name of the macro you're looking for, in a WYSIWYG manner similar to Prompt with List.

I think it would be very nice to have the option to search by name only, rather than by name and contents, without the need for a visible n: search string.

Failing that, I would say that a fairly incontrovertible improvement would be for the cursor to be positioned after the initial search string when the prompt appears.

Just my ten cents.

1 Like

This seems reasonable to me. It would make it easier to have different promts of "Trigger Macro by Name" with different search strings (initial search). The obvious advantage is that nothing is overwritten, but you can continue writing directly. This option makes it really useful to have "Trigger Macro by Name" multiple times, either triggered with different shortcuts or a conflict palette. Maybe only I think it's a good idea.

1 Like

I suppose the reason I'm thinking like this is that Trigger Macro by Name is a really good alternative to palettes, but it lacks immediacy because of the added keystrokes required to avoid overwriting search strings. Personally, I don't see the point of making the pre-defined initial search strings visible when the user will have made a decision that this is how the action should function when triggered. Perhaps there are reasons someone might set it up and with n:, trigger it, and then delete n:, but I can't imagine them. I think making them invisible should be an option, but that's just my opinion.

At the risk of excessively labouring the point... If I want to search by name, for global macros, excluding one app, that don't have a hotkey and were created in the past 5 weeks, modified and used within the past two weeks... I might end up with this:

Yes, I know this is an unlikely level of granularity, and I could create a Smart Group, but if this could all be invisible, I wouldn't have to.

I believe you are incorrect about this.

Frank suggested manually moving the cursor to the end of the filter text.

I suggested using a Keyboard Maestro macro to do it. I've done this before, but it's too much trouble to try and find it right now. (I had to use an asynchronous sub-macro to get it to work properly.)

I also said that I think @DanThomas already has a macro that does this on the forum, although I may be mistaken about the cursor management.

1 Like