Is there an easy way I can add custom icons to the menu bar status area? Ideally something like Growl (e.g., where you can just execute a command) but instead of notifications, just renders icons in the menu bar.
I'm mainly looking to draw numbers that I'd use to alert me of various things. For example, I can configure my email client to run a command/AppleScript to update the numbers when an certain kind of email arrives.
Something like this:
Best Answer
I would suggest starting with this thread, which describes using Cocoa Objective-C calls from within AppleScript. There is an example Xcode project here.
And Launch is a complete application written in AppleScript that functionally does this. Its Xcode project file is here.
The basic premise is to generate NSMenuItem instances and add them to the system's NSStatusBar:
AppleScript excerpt from Launch's source code, Copyright © Lee Hanken