Is there a way to show the exact number of unread mails from the Mail.app icon also in the title bar? Note that this is not the same as showing the number of unread mails in inbox, since I can change the folder to something else like a smart mailbox.
(A script which outputs this number would also be okay; I could write a menu bar item around this myself.)
Update: Alternatively, a script which outputs the number of unread mails for a user-definable smart mailbox is also okay. All example code I’ve seen so far only works for non-smart mailboxes.