문제

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