Skip to content

Instantly share code, notes, and snippets.

@youzi
Last active March 12, 2018 10:05
Show Gist options
  • Save youzi/8b69cbc2131bc78ff3714e9e7c72835f to your computer and use it in GitHub Desktop.
Save youzi/8b69cbc2131bc78ff3714e9e7c72835f to your computer and use it in GitHub Desktop.
Create dialogs for each Mac OS notification, making them "tabbable".
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