imagitronics.org


dream it, build it, break it, repeat.

Jun/07

25

The software

Even though the project was born out of a need at work, I decided that I would target the Mac platform first. There’s no good reason for this decision, other than the fact that I love Macs.

My original design idea was actually to calculate the number of windows open on the system at any given time, and change the light based on that figure. There’s actually a major distinction between how many windows you have open, and how many applications you have running. I was violently opposed to polling the system for status changes. I demanded that the light changed instantaneously when a new event occured.

My friend Tom recommended that I check out the NSDistributedNotificationCenter feature in Cocoa. This is a class that is available to all applications, and allows you to get some pretty interesting information from your computer such as when a new application is launched or the computer is preparing for sleep. Unfortunately, it doesn’t allow you to find out how many windows are open on the system.

Tom also gave me some applescript code that would enable me to count the number of open windows on the system, but I insisted on using notifications. I was certain that other programs, such as Mail.app and iCal would post useful notifications that I could use to determine the number of unread emails, scheduled appointments etc

RSS Feed

<<

>>

I shop at

Theme Design by devolux.nh2.me

Hosted in the cloud

To top

imagitronics.org is Digg proof thanks to caching by WP Super Cache