How do I clear All OS X notifications with 1 click?
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
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.
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.
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.