Skip to content

Instantly share code, notes, and snippets.

@hannestyden
Last active December 12, 2015 00:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannestyden/4681510 to your computer and use it in GitHub Desktop.
Save hannestyden/4681510 to your computer and use it in GitHub Desktop.
-- Close annoying notification windows that you can't Cmd+Tab to.
-- From: http://www.mentby.com/stockly-ed/window-watcher.html
tell application "System Events"
try
set unc to application process "UserNotificationCenter"
activate unc
set uncw to window 1 of unc
repeat with label in {"OK", "Close", "Ignore", "Cancel"}
try
click button label of uncw
end try
end repeat
end try
end tell
@robb
Copy link

robb commented Jan 31, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment