4

It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite):

on run
    tell application "System Events"
        tell process "Notification Center"
            set theseWindows to every window
            display notification (count of theseWindows)
        end tell
    end tell
end run

This were supposed to get all notifications listed in the Notification Center. However, the count attribute always returns 0.

Does anyone know how to retrieve all notifications in the Notification Center different than the script above?

Thnaks for the help!

  • That will actually get the Notifications that pop up on your screen – markhunte Nov 10 '14 at 22:40
  • That should be fine. But still that code doesn't work as expected. Can't list all notifications. Seems like the OS X won't allow you to get that listing. – Fabio Moggi Nov 10 '14 at 22:52
  • What do you mean Can't list all notifications.?? It does work. The code is structured to list any open alerts but not the one it throws up on that run. – markhunte Nov 10 '14 at 23:31
  • In fact, I would like to be able to get a list of SMS from the Messages.app. As far as I am concerned, I don't have access to the SMS database programatically due to Apple security policy. As a workaround, I am doing SMS forwarding by reading the notification center as soon as the message arrives. However, even that approach is just too weak as I am using an applescript to simulate the user experience of reading the SMS. I wish I could have access to the data directly – Fabio Moggi Nov 11 '14 at 5:36

You must log in to answer this question.

Browse other questions tagged .