I have notifications in the OSX Notification Center, as for most of my apps I am using the setting, "Show in Notification Centre: 10 Recent Items" This is a good setting but rather than have a very full Notification Center, I would still like to clear it from time to time with 1 click.

I am using Yosemite 10.10.3

10 Answers 10

tell application "System Events"
    tell process "NotificationCenter"
        set numwins to (count windows)
        repeat with i from numwins to 1 by -1
            click button "Close" of window i
        end repeat
    end tell
end tell

Copy and Paste the above code into AppleScript Editor Enable Script Editor in Accessibility

System Preferences enter image description here

  • Fantastic solution! I mapped your script to a keyboard shortcut in BTT: boastr.net – cody.codes Sep 28 '19 at 15:30
  • How do you invoke this? – Quantum Mechanic Jan 16 '20 at 20:28
  • 1
    This doesn't work on Big Sur: System Events got an error: Can’t get button "Close" of window 1 of process "NotificationCenter". (-1728) – HappyFace Mar 13 at 11:47

Another option, which uses Keyboard Maestro to run an Applescript is detailed here: http://genuinecuriosity.com/unnotify

I have it mapped so that I hit Command Option 0 to clear all open alert dialogs.

Basically, I have created an Applescript to click the first button on all open alerts (typically Close), and does that until all alerts are cleared. You can use the Applescript directly through Keyboard Maestro (as described in my article), or you can create a Service with Automator (this is a little more finicky due to Accessibility permissions requirements).

The full Applescript is included in the article, along with a screen grab showing the setup in Keyboard Maestro. Script employed in Keyboard Maestro

  • It's helpful if you briefly summarize the linked reference as links can go stale in the future. – Allan Jun 6 '16 at 9:28
  • Brilliant thank you! You can copy paste the script into Alfred as well. – Dylanthepiguy Oct 20 '17 at 5:40

I don't know a way to clear every notification with a single button, however you can clear all of one app's notifications by moving your mouse to the right of the app's header and clicking the small x button that appears there.

To clear them all, I simply move the mouse to the topmost app's x button and rapidly click which removes all of the notifications relatively quickly.

  • 1
    thanks, that is what I do. Clicking the small x at the top of each notification section for 20 apps, is definitely not fast in my book. Not sure why you popped reply as an answer. – sea May 4 '15 at 18:18
  • @sea Haven't got comments yet – Sébastien May 4 '15 at 18:50
  • 1
    I don't see any "small x" on El Capitan 10.11.1 – Meekohi Nov 3 '15 at 14:35
  • 2
    You can close by day, if you hover over the day header line. – Tetsujin Apr 7 '16 at 14:36

I know this was originally for Yosemite, and I'm not sure the answer there, but given the question is 3 years old, and I just found it while looking for the same thing with Mojave, I thought I'd mention the answer I found.

enter image description here

on the very right of the menu bar, click on the 3 lines, this brings up a window with Today / Notifications tabs. If you select the Notifications tab, you can click the X to the right of Today to clear all the notifications for a given day. a few clicks and you'll have all the old ones cleared.

  • Would this clear a backlog of notifications? – ChristoKiwi Dec 16 '18 at 22:26
  • yes, that's the idea. I use it periodically to clear out a lot of notifications. – Kem Mason Dec 18 '18 at 20:24
  • If u wanna stay away from scripts this is the answer! – Ben Racicot Mar 27 '19 at 13:41
  • This cleared the day's notifications from Notification center, but it didn't dismiss "Alerts", (the persistent window type of Notifications that can be chosen in System Prefs -> Notifications). The short applescript solution by "@software is fun" did clear those. The question is about Notifications, but I wanted to note that distinction here. – Joshua Goldberg Mar 30 '20 at 12:39

I ended up creating an Automator script to do this and mapping it to a global hotkey.

on run {input, parameters}
    tell application "System Events"
        tell process "Notification Center"
            set theWindows to every window
            repeat with i from 0 to number of items in theWindows
                    set this_item to item ((number of items in theWindows) - i) of theWindows
                    click button 1 of this_item
                on error
                    -- nothing
                end try
            end repeat
        end tell
    end tell
end run

The small X in El Capitan is in the notification window. Open the Notification pane by sliding in from the right on the mouse or clicking on the notification center icon in the upper left corner. Each application's notifications are grouped together and there is a little X on the right side of each application's header. Click that X and the notifications all go away.


This SIMBL app does the trick nicely. chuckhendo/NotificationClear: SIMBL bundle to add a "Clear All" button to Notification (https://github.com/chuckhendo/NotificationClear)

Just install it using mySIMBL. w0lfschild/mySIMBL: SIMBL plugin manager for macOS (https://github.com/w0lfschild/mySIMBL)

Once installed, you can just open the notification center, then click "Clear" on the bottom.


Change the annoying notification app in the notifications preferences, from "alerts" to "banners". Banners are automatically dismissed after few seconds.


Alt-click usually works to perform one operation on multiple things.


Just go into the activity monitor and force quit the notification center...

  • Welcome to Ask Different and thank you for your answer. :) Unfortunately, short answers such as this don't really provide enough detail or context to help many users. If possible, it'd be good if you could add some more info keeping in mind many users won't know how to go about doing this. Also, you may want to read How to Answer for tips on providing answers here. – Monomeeth Nov 17 '18 at 3:05
  • Joey, this answer should be more highly rated. I hated (possibly) hundreds of notifications telling me that my external drive was not ejected properly. These notifications did not show inside Notification Center and had to manually be "Closed". Force quitting Notification Center removed them all! Thanks mate – Zander Apr 15 '20 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .