Created
January 15, 2016 16:29
-
-
Save bezhermoso/2a1ee72399bbb7b925e4 to your computer and use it in GitHub Desktop.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my closeNotifications() | |
on closeNotifications() | |
tell application "System Events" | |
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 | |
on error | |
my closeNotifications() | |
end try | |
end repeat | |
end tell | |
end tell | |
end closeNotifications |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment