Frage

I was trying to figure out a way how to capture notifications coming from - for example - the integrated mail.app. I was using the NSUserNotifications and acted as an observer but none of the Mail.app notifications were captured.

Is there a way in cocoa to capture NSNotifications coming from other apps? Especially the Mail.app?

War es hilfreich?

Lösung

Although it is not possible to capture Mail.app notifications it is possible to use a NSMetadataQuery Live Search with a predicate bound to kMDItemType == "com.apple.mail.emlx" to start a live query including all mails. Everytime the user receives a new mail - the query will be updated!

This is not the answer to my question but this is my working workaround!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top