So, my simple weekend hack Gmail+Growl is now famous. Also, I am not only a “user”, but apparently “clever”. Nice. Thanks.
This begs the story of how it all happened anyway. Here it is:
It was a dark and stormy night. Chains rattled, owls hooted. NetNewsWire downloaded the hourly news. News spread about Google’s first native Mac app, Gmail Notifier for Mac OS X. I downloaded it and it was fucking fabulous. I am not joking and I am not sucking up - it was really fucking fabulous.
After having sent myself a test mail to see what little jig it would do upon mail reception, I saw it. The sound alert I had set worked, a number was shown (unlike the Windows version, which I also rely on religiously) and, being a menu extra, I pulled down the menu and saw the extra menu for listing the mails. However, I did miss the Growl integration I enjoy with iTunes (through Synergy), Adium and other apps.
(Aside: Growl is an open framework that allows lovely notifications to appear when something happens - iTunes starts playing a new song, a mail is received, a buddy comes online on Adium, you name it. It’s quite nice. Windows users have this through some apps’ own built-in versions (MSN Messenger was first) and calls them “toasts”, from what I know, but there’s nothing like Growl.)
A minute later I found myself wanting to dissect the little bugger. This is perhaps an unusual habit but I find myself doing it from time to time.. Finder. /Applications. Gmail Notifier. Show Package Contents. Contents. Resour- hey. Is that a Headers folder? Is that a Headers folder?
And it is at this point in the story that you have to understand that when a Cocoa programmer missing functionality finds a folder commonly used to store plugin APIs, he will pounce on it. And so I did. GGPluginProtocol.h. HeaderDoc annotated! This guy really did know what he’s doing. Awesome.
The rest is a blur of trying to “weak link” - which means that you’re telling your app “okay, if this thing is here, use it, otherwise don’t” - in the Growl framework. Linking in OS X is divided up into weak and hard (traditional) linking, and likewise, the documentation about how to weak link is weak, and the actual process of weak linking is hard. (It was for me anyway.)
The actual code went from investigating the small NSDictionary objects (”hash-tables”, if you will) to find out keys, to popping up a Growl notification with all the data, to popping up a succinct name, subject, summary Growl notification adorned with the Gmail Notifier logo in less than 10 minutes. A customizable cap was added at 6 notifications to keep from flooding the display at a loaded inbox (the Gmail Notifier caps at 20, but that’s not enough for Gmail+Growl), a suspiciously composited logo was grafted on a web page with a suspiciously nice look, and I put it out on its virgin cruise.
I showed it to a few friends, I posted one email to the Growl discussion list and later on, I posted one comment on a MacSlash post about the Gmail Notifier. That’s all the promotion I’ve done. This, if anything, is absolute proof that if you build it, they will come. (In this case, probably in droves.) I was lucky and found the API (best easter egg so far this year), I built a plugin to scratch my itch and released it because I know that many others have the same itch. It’s not perfect by any means. But it works, and it fills a function.
I like it.