Howdy,
I'm looking for an applescript that is able to read notifications on Mac OS. Active notifications or those stored in the Notification Center. I was trying this:
on run
tell application "System Events"
tell process "Notification Center"
set theseWindows to every window
set notificationsList to {}
repeat with thisWindow in theseWindows
try
tell thisWindow
set thisTitle to get value of static text 1 of scroll area 1 of group 1
set thisText to get value of static text 2 of scroll area 1 of group 1
set end of notificationsList to {thisTitle, thisText}
end tell
end try
end repeat
return notificationsList
end tell
end tell
end run
But getting this error:
error "System Events got an error: Can’t get static text 1 of window 1 of application process \"NotificationCenter\". Invalid index." number -1719 from static text 1 of window 1 of application process "NotificationCenter"
Is this possible? Any help would be greatly appreciated. Running Mac OS Ventura.
Thanks!