Re: Receiving system notifications in 10.8

2013-10-11 Thread Jens Alfke

On Oct 10, 2013, at 9:40 PM, Carl Hoefs newsli...@autonomy.caltech.edu wrote:

 Lots of applications come to mind, if such a mechanism were available. To be 
 able to know when a certain song is playing in iTunes Radio and crank up the 
 volume,

There is (or used to be) an NSDistributedNotification that iTunes posts 
whenever the currently playing track changes. I don’t know if it’s documented 
anywhere, but you can discover what it is by writing a tiny app that adds an 
observer for all distributed notifications of any time and logs them.

 or to send out a text/email/tweet when certain notifications are posted, etc. 
 I would think this would be Generally Useful. Wish there were a way…

It could be useful. But it would be a very different facility, since the data 
posted in the notification would need to be machine-readable not human-readable 
— instead of a localized string you’d want something like an NSDictionary with 
well-defined keys. (The types of notifications sent out would likely be 
different too. For example, there’s no point displaying a visible notification 
when Mail sends a message, but an internal notification would be useful.)

Anyway, this facility already exists — it’s NSDistributedNotification. What 
you’re asking for is basically for more apps to support posting them, which 
isn’t a technical issue so much as one of evangelism.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Receiving system notifications in 10.8

2013-10-10 Thread Carl Hoefs
How does one receive notifications from 10.8's new system-wide Notification 
Center? Is there a framework that allows a Cocoa program to receive system 
notifications, i.e., the ones that show automatically in the upper right hand 
of the screen?

- Carl


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Receiving system notifications in 10.8

2013-10-10 Thread Jens Alfke

On Oct 10, 2013, at 7:38 PM, Carl Hoefs newsli...@autonomy.caltech.edu wrote:

 How does one receive notifications from 10.8's new system-wide Notification 
 Center? Is there a framework that allows a Cocoa program to receive system 
 notifications, i.e., the ones that show automatically in the upper right hand 
 of the screen?

No, it’s the other way around — Notification Center is for apps to _send_ 
notifications to, not receive them. The notifications are purely for the user 
to see.

There are several existing mechanisms like NSDistributedNotification, 
NSWorkspace and kqueues for getting programmatic notifications of things 
outside your process. Is there something specific you want to be notified of?

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Receiving system notifications in 10.8

2013-10-10 Thread Carl Hoefs

On Oct 10, 2013, at 9:28 PM, Jens Alfke j...@mooseyard.com wrote:

 
 On Oct 10, 2013, at 7:38 PM, Carl Hoefs newsli...@autonomy.caltech.edu 
 wrote:
 
 How does one receive notifications from 10.8's new system-wide Notification 
 Center? Is there a framework that allows a Cocoa program to receive system 
 notifications, i.e., the ones that show automatically in the upper right 
 hand of the screen?
 
 No, it’s the other way around — Notification Center is for apps to _send_ 
 notifications to, not receive them. The notifications are purely for the user 
 to see.

Tantalizing, to be able to see them and not act on them programmatically.
 
 There are several existing mechanisms like NSDistributedNotification, 
 NSWorkspace and kqueues for getting programmatic notifications of things 
 outside your process. Is there something specific you want to be notified of?

Lots of applications come to mind, if such a mechanism were available. To be 
able to know when a certain song is playing in iTunes Radio and crank up the 
volume, or to send out a text/email/tweet when certain notifications are 
posted, etc. I would think this would be Generally Useful. Wish there were a 
way...

- Carl


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com