Trigger Macro by Name - Limit to Smart Group Results?

The only way to filter by application/global availability is to have ap: or gl: in the search field. This seems a little inelegant to me, but not the end of the world. The ideal scenario would be to be able to select Smart Groups, as you can any other groups, but evidently it's not an option. So, what I should have said in my last comment was:

Ah, I see, you would prefer nothing to be there. But if there is nothing there, the search can't be narrowed. There are problems for which there is no ideal solution, unfortunately :man_shrugging:

That isn't quite true, because you can narrow by group here:

I wondered why narrowing by Smart groups wasn't also an option in that same menu. I've opted for your approach, and it's good enough.

1 Like

Make a feature request to Peter.

That might be unexpectedly complex to implement, but he's the one who would know.

Sorry to bother you @peternlewis, but what you reckon?

Actually, the Trigger Macro by Name action works fine with Smart Groups, it is just, err, hard to set them.

Add a macro group, and then drag a macro Smart Group over the added macro group to replace it with the smart group and it should work fine.

I'll look at fixing the UI so you can select it appropriately.

4 Likes

Fixed for the next version.

Also, it's easier than dragging, just add anything, and then select from the resulting popup menu and the option to select the Smart Group is now available in the menu.

1 Like

I take it back... I'm happy to have bothered you!

That's great! Thanks, @peternlewis!

Edit:

Hmm... Not sure what's going on here. I've created two smart groups:

CleanShot 2022-10-24 at 10.43.02@2x
CleanShot 2022-10-24 at 10.43.36@2x

I've set up a macro that will list all active macros available...

  • in the current app: §
  • globally: ⌥§

Trigger Macro by Name.kmmacros (28 KB)

Macro screenshot

For some reason, it still pre-fills the Initial Search field with ap:, so when you attempt to show all globally available macros, the list is empty:

Possible bug? @peternlewis

I would guess either the text is still in the Initial search field (maybe hidden by a newline or something?), or you are confused about the action you are running?

It wont be getting the "ap:" from the smart group, so the fact that it is getting it means it is still in the action that is being run.

I'd have thought the same thing, but:

CleanShot 2022-10-25 at 10.17.14

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.