Skip to content

Instantly share code, notes, and snippets.

@daohsong
daohsong / notification-actions.applescript
Created September 1, 2020 21:27 — forked from bezhermoso/notification-actions.applescript
Handly AppleScripts to manage OS X notifications. (Use in Automator, bind to keyboard shortcuts via BetterTouchTool, etc.) Inspired by http://apple.stackexchange.com/a/155736
# Close all notifications
my closeNotifications()
on closeNotifications()
tell application "System Events" to tell process "Notification Center"
set theWindows to every window
repeat with i from 1 to number of items in theWindows
set this_item to item i of theWindows
try
click button 1 of this_item