Last active
March 12, 2018 10:05
-
-
Save youzi/8b69cbc2131bc78ff3714e9e7c72835f to your computer and use it in GitHub Desktop.
Create dialogs for each Mac OS notification, making them "tabbable".
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
on run {input, parameters} | |
tell application "System Events" | |
tell process "NotificationCenter" | |
copy windows to notifications | |
repeat with notification in notifications | |
set btnNames to {} | |
set btnName to "OK" | |
set n to number of notification | |
repeat with btn in buttons of notification | |
set btnName to name of btn | |
set end of btnNames to btnName | |
end repeat | |
set answer to display dialog "Notification " & n buttons btnNames default button btnName | |
repeat with btn in buttons of notification | |
if button returned in answer is equal to name of btn then | |
click btn | |
end if | |
end repeat | |
end repeat | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment