質問

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?

役に立ちましたか?

解決

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!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top