IF condition focused_window_app_name doesn't notice Notification Center reliably

Note:
Before bug reporting, please make sure you have tried the latest (alpha) version of BetterTouchTool and that you have already tried to restart your system :-). If you encounter a crash, please attach a crash log from the macOS Console.app from the "User Diagnostic Reports" section.


Describe the bug
I'm using the IF condition set to this:
focused_window_app_name != "Notification Center"

I use this to check whether Siri is still visible after a previous "Start Siri" command. This works the FIRST time it's being checked after Better Touch Tool is restarted, the next time, BTT won't react to Notification Center being the focused app name. You can tell that it SHOULD get it from opening the observer window that lists the current focused element which changes 100% correctly when opening and closing Siri (Start Siri) but BTT's IF condition only react correctly the FIRST time after restarting BTT. After this, there is no change anymore of focused app name when Siri activates. You can tell by keeping the IF condition window open and activating Siri. First time doing this after restarting BTT, it correctly switches to TRUE / FALSE, but after a trigger has been activated using the IF condition for this, opening the window again to check, it no longer reacts correctly to the change.

I hope that was clearly described.

Tried restarting and all other things I can think of.

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
I'm using a keyboard sequence as trigger

Screenshots
If applicable, add screenshots to help explain your problem. (You can just paste or drag them here)
See quick illustration of what's wrong here: https://youtu.be/GpURBX8fHQ0

Device information:

  • Type of Mac: Macbook Pro M1 Max
  • macOS version: 15.4.1
  • BetterTouchTool version: (please post the exact version - not just "the latest one")
    5.294

Additional information (e.g. crash logs, related issues, etc.):

Does your siri window really steal focus from other apps? For me it doesn't or only does if I click it explicitly.

Maybe you could try this condition instead:

visible_window_list CONTAINS "Notification Center - Notification Center - 23"

It does in Sequoia as Start Siri command opens text input, not voice. It does shift focus according to inspector window in btt too.

My idea was to make a Siri voice shortcut because macos does just that: assuming text input.

Text input is independent of window focus. At least on my system it only changes window focus when clicking the siri prompt, maybe you are clicking it while testing in the inspector window? You can see whether the window focus changes if the window buttons of your active window switch to grayscale

This condition should always work regardless of focus state:

visible_window_list CONTAINS "Notification Center - Notification Center - 23"

Nope, I don't click anything apart from the shortcut that starts Siri in text mode, check out the video:

https://youtu.be/GpURBX8fHQ0

Your suggestion worked though but with:
"Notification Center - (null) - 23"

Ah yes, in that video you can see that the window buttons of the BTT window are not going gray scale. This means BTT is still the focused app.

It's complicated but focused_window_app_name will not work in this case, because that would still be BTT.
There can be focused elements in other apps while the main focused app is still another.

Ah and if you want to reference what you see in the "focused ui element viewer" you can use

focused_element_details CONTAINS "<AXApplication: \"Notification Center\">"

Oh, wow, what a mess. Weird how it seems to work at first, then not.

But I'll just use one of the other solutions, thanks!!

Hehe it's not really a mess, the various focus states enable a lot of important features in macOS.

1 Like