This ONLY works for OSX Mail. Feel free to change though.
I wanted a glet that gave me the unread email count for osx mail as i always have my dock hidden. The real work is done by the applescript file (mail_count.scpt) all the glet does is run it every 20 Seconds with a timeout of 3 seconds.
Feel free to use my glet, or add your own (shell). Also, check "mail_count.scpt" if you want to change the output or see how it works. By default if "Mail" is closed the script will run but it will not access any email and will no open the mail application, you can change this, but i would recommend it.
Place "mail_count.scpt" somewhere safe (i.e. Dropbox, etc)
Create a Shell Geeklet - Refresh Rate: 20 s Timeout: 3 s
If you see "Mail is not Running!"
Open Mail, and refresh
If Mail is running verify that the name is in fact "Mail.app" in the applications folder.
Thanks and i hope you all enjoy.