Created
July 23, 2022 14:23
-
-
Save Sangdol/7aed31e13f68b8f916045b5b3f1938b5 to your computer and use it in GitHub Desktop.
An AppleScript that closes notifications
This file contains 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
# https://apple.stackexchange.com/questions/408019/dismiss-macos-big-sur-notifications-with-keyboard | |
my closeNotif() | |
on closeNotif() | |
tell application "System Events" | |
tell process "Notification Center" | |
set theWindow to group 1 of UI element 1 of scroll area 1 of window "Notification Center" | |
# click theWindow if you want to open the app | |
set theActions to actions of theWindow | |
repeat with theAction in theActions | |
if description of theAction is "close" then | |
tell theWindow | |
perform theAction | |
delay 0.5 | |
my closeNotif() | |
end tell | |
end if | |
end repeat | |
end tell | |
end tell | |
end closeNotif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment