Created
April 21, 2024 20:52
-
-
Save gartnera/e00496af19ffbb4c7d1365e87baf8c23 to your computer and use it in GitHub Desktop.
applescript to activate/raise the first notifcation on macos sonoma
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
tell application "System Events" | |
-- this is a custom keyboard shortcut for command + control + left arrow (Mission Control -> Show Notification Center) | |
keystroke (ASCII character 28) using {control down, command down} | |
end tell | |
tell application "System Events" | |
set _first_notification to group 1 of UI element 1 of scroll area 1 of group 1 of window "Notification Center" of application process "NotificationCenter" | |
-- this activates the notification group | |
click _first_notification | |
-- this actually follows the notification | |
click _first_notification | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment