On Jan 8, 2009, at 7:39 AM, Jerry Krinock wrote:

On 2009 Jan, 07, at 22:46, Chunk 1978 wrote:

does this work with Dashboard?  it seems that dashboard is a
background application that's always open...

Well, obviously it does not.

You'd need a NSWorkspaceDidActivateApplicationNotification, but it looks like there is no such thing. You could periodically poll - [NSWorkspace activeApplication], but I hope someone has a better idea, because if you do I would not want your process running on my Mac.

For typical apps, you can register for the Carbon event (kEventClassApplication, kEventAppFrontSwitched) which will let you know as apps get activated.

However, I doubt the Dashboard is a typical app in this sense. I haven't tested that assumption, though. Perhaps the Accessibility API will help, in that case.

Cheers,
Ken

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to