Guest User

Untitled

a guest
Mar 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. on run {input, parameters}
  2. tell application "System Events"
  3. tell process "NotificationCenter"
  4. copy windows to notifications
  5. repeat with notification in notifications
  6. set btnNames to {}
  7. set btnName to "OK"
  8. set n to number of notification
  9.  
  10. repeat with btn in buttons of notification
  11. set btnName to name of btn
  12. set end of btnNames to btnName
  13. end repeat
  14.  
  15. set answer to display dialog "Notification " & n buttons btnNames default button btnName
  16. repeat with btn in buttons of notification
  17. if button returned in answer is equal to name of btn then
  18. click btn
  19. end if
  20. end repeat
  21. end repeat
  22. end tell
  23. end tell
  24. end run
Add Comment
Please, Sign In to add comment