Feedback/suggestion: Trigger Macro by Name *only* option

Ah, I see. Yes, I can confirm this behaviour.

Must be that the back-end logic dictates that an exclusion is treated as an "inclusion except for...".

I've actually never used app exclusions, so this is new to me.

@peternlewis, is this right?

I believe it is doing exactly what you are telling it to.

app:Finder matches "every Group with any availability qualifier for Finder" -- and "Available in all applications" is not a qualifier.

app: without an argument means "every Group with any availability qualifier for any application".

So by only listing macros in the "App-specific" group you are filtering out all those in "all apps" Groups.

What are you trying to list in your Prompt? If it's "all globally available macros plus those specific to any app" then try:

Multiple strings give an OR search (multiple items in the same string are an AND within that string).

I understand that "any availability qualifier for any application" includes not available, but what I find interesting is that...

  1. With Keyboard Maestro at the front, triggering a Prompt with List that references the app-specific smart group will show only macros available in Keyboard Maestro. :white_check_mark:

  2. If I then take another macro group that was previously available in all apps and give it a negative qualifier...

...its macros are suddenly also available in Keyboard Maestro (or any other app). :exclamation_question_mark:

I'm led to believe that, although any qualifier might match the smart group search, their actual availability is still based on positive qualifiers, so I wonder if the back-end treats Available except in these applications: as a positive qualifier "for all apps except this one".

It would explain the macros appearing in every other app.

Compare the contents of the Smart Group with the contents of the Prompt (limit your test set to a total of <20 macros so you see everything).

Consider the following two Groups:

The Smart Group matching `app:"Keyboard Maestro" is:

...and includes the contents of both "Keyboard Maestro" positively- and negatively-qualified Groups and no others.

The Prompt then applies its own settings to that list, usually to only display the currently active macros:

...though not necessarily:

Demo macros for the above:
SG Demo.kmmacros (5.6 KB)

I'm not seeing your "negative qualifier appears in every other app" behaviour -- I'm thinking it's a Smart Group or Prompt option that's gone awry. Try it with the demo set -- setting the "KM Out" Group to "except in Finder" still gives me the expected results:

My Smart Group doesn't use app:"Keyboard Maestro"
It uses app:

That might be why.

So it's the same result as @rolian is seeing, except viewed from the opposite direction. And it's for the same reason -- your Smart Group matches all Groups with any application availability restriction, positive or negative, only omitting the "Available in all applications" Groups.

The application: Search String is defined on the wiki:

as Match any macro that is specific to (or excluded from) the specified application.

So the search app:Finder finds any macro that is specific to or excluded from the Finder, and app: finds any macro that is specific to or excluded from any application.

That seems to match the observed behaviour - it matches any macro that is specific to any application, or excluded from any application, but not any macro that is in all applications.

Are we speaking at cross-purposes or am I just not grasping something?

The Smart Group behaves exactly as I'd expect. It's the available macros listed in the prompt that are a bit perplexing.

The prompt will show any macros available for the frontmost app, PLUS any macros in groups that have an app availability exception.

The Prompt should show all the macros listed in the Smart Group minus any that are inactive because of the current context (assuming you've set it to "Active macros").

For example -- when KM is frontmost, the Prompt should show all the "Available in Keyboard Maestro" and "Available except in Finder" macros, assuming no other conditions (eg window names).

I've just realised I've been looking through the wrong end of the telescope and this makes absolute sense.

:sweat_smile:

The problem is you've got a lot of Groups with a lot of different +/- app filters -- that makes it difficult to see what's happening.

If you get a chance and have an old machine or can spin up a VM, put the KM trial on and play with half a dozen Groups with a couple of macros each. If only to be sure I haven't bamboozled you :wink:

If you make a group available except for in one app, of course it's available in all of the others. :man_facepalming:t2:

I bamboozled myself!

Thank you, thank you. I now understand. And your method for getting the “global” ones when I went will be useful.

Got it now. Thank you.

Well that took the scenic route, didn’t it! To return to, and close, the original matter, here’s a statement from @peternlewis that I just found in a thread (which had also drifted a little from its initial topic) from 2022:

Trigger Macro by Name - Limit to Smart Group Results? - #47 by peternlewis
(My emphasis)

So that’s that.

Although..!!

:speak_no_evil_monkey:

:zipper_mouth_face:

That’s perhaps overthinking it? Or is it perhaps underthinking it? :thinking:

A Trigger macro by name type of action (or mode of the existing action) that couldn’t do anything other than trigger a macro by name* would be comparable to the insert action by name feature in the KM Editor—perfect for the job!

Anyone who needed to add more filtering (is there any evidence that such a user exists?) could still use the current action (or current mode of the action).

Well… I don’t mean to start another debate. That’s just my view of what is and isn’t needed, should the matter ever be reconsidered.

* Retaining the scope feature of the action; that’s very useful!