Skip to content

Instantly share code, notes, and snippets.

@gingerbeardman
Created June 1, 2025 19:20
Show Gist options
  • Save gingerbeardman/9c2df74528c8ff911bc1f09ef942941c to your computer and use it in GitHub Desktop.
Save gingerbeardman/9c2df74528c8ff911bc1f09ef942941c to your computer and use it in GitHub Desktop.
Dismiss all notifications
osascript -e '
tell application "System Events"
tell process "NotificationCenter"
if not (window "Notification Center" exists) then return
set alertGroups to groups of first UI element of first scroll area of first group of window "Notification Center"
repeat with aGroup in alertGroups
try
perform (first action of aGroup whose name contains "Close" or name contains "Clear")
on error errMsg
log errMsg
end try
end repeat
-- Show no message on success
return ""
end tell
end tell'
@gingerbeardman
Copy link
Author

gingerbeardman commented Jun 1, 2025

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