"Close All Notification Alerts / Notification Center" is not working on macOS Sequoia 15.0

Describe the bug
The action "Close All Notification Alerts / Notification Center" is not working after upgrading the os to the latest Sequoia 15.0

Device information:

  • Type of Mac: MacBook Pro 14-inch, 2023
  • macOS version: macOS Sequoia 15.0
  • BetterTouchTool version: 4.699

I have adapted the action so it should work again.
Could you try whether v4.700 solves the issue for you?

My custom AppleScript for closing all notifications also broke during the update to Sequoia.

I got it working again with this script:

tell application "System Events" to tell application process "NotificationCenter"
	try
		perform (actions of UI elements of UI element 1 of scroll area 1 of group 1 of group 1 of window "Notification Center" of application process "NotificationCenter" of application "System Events" whose name starts with "Name:Close")
	end try
end tell
1 Like

Looks good and is part of what I also do in 4.700! (localized to support non-english macOS as well)
That only works for notifications that are "open" / visible and not in the notification center drawer though, right? (BTT's action also wants to close the notifications in notification center when it is opened)

1 Like

With version 4.700, I can confirm that notifications can be closed again! Thanks to both of you!

1 Like

That's correct! This was my intended functionality. A helpful new feature would be to add a setting in the Close All Notification Alerts / Notification Center action to toggle this on and off.

So many hours I've spent learning AppleScript, I have a love/hate relationship haha

I hate it for how annoying it is, but love it for how powerful it is :wink:

1 Like

Hey, when I try to run this script, I found that it only works on single notifications, not in group messages. If there are any group messages, it returns "missing value" as a result.

Hi Hackett, I'll have some time to look into this sometime later today.

Can Confirm works anew for me :slightly_smiling_face: Thx guys life is good again :slightly_smiling_face:

Wait, does it work with grouped notifications for you? I've tried it, but it doesn't seem to work well on my end.

Yes it seems, I opened my notification panel right now and ran the shortcut and it dismissed a whole lot messages at least.

@HackettLai does the BTT action also not work for you?

The built-in BTT functions work well for me, @asgeirtj. My issue only occurs when I run the Apple Script standalone, such as via the "Script Editor." As you can see in the video below, it only works when I close all the groups into a single notification at the end.

Just in case you need to trigger the BTT "close all notifications" action from Apple Script for some reason, you can do this:

tell application "BetterTouchTool" to trigger_action "{ BTTPredefinedActionType: 289}"
1 Like

@HackettLai @asgeirtj

I fixed the script to also close Stacked (group) notifications:

tell application "System Events" to tell application process "NotificationCenter"
	try
		perform (actions of UI elements of UI element 1 of scroll area 1 of group 1 of group 1 of window "Notification Center" of application process "NotificationCenter" of application "System Events" whose name starts with "Name:Close" or name starts with "Name:Clear All")
	end try
end tell

The difference is that I added or name starts with "Name:Clear All" in the whose query.


Note:

Andreas pointed out that this script only works for English macOS localization. I haven't figured out how to account for non-English localization.

In any case, Andreas' script works great too!

When using Andreas' script, don't forget to add your Shared Secret! i.e.

tell application "BetterTouchTool" to trigger_action "{ BTTPredefinedActionType: 289}" shared_secret "your_shared_secret"
1 Like

Thanks @fortred2 !!!!!! It is working perfectly!

This only works for en_en locale? I recently changed mine to Icelandic defaults read NSGlobalDomain AppleLocale

is_IS
would I need to find out the Icelandic names for these values then? :stuck_out_tongue:

BTT’s close all notifications action should work with all languages