Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

A few other e-mail applications allow you to set their dock counter to the number of messages in the inbox, rather than just the number of unread messages. The idea being that until it's out of the inbox, it's still an active task that needs to be resolved.

So what I'm after is the ability to do this with Mail.app in OS X Mavericks. Currently there's only a drop-down preference for:

Dock unread count: Inbox only
                   All Mailboxes

Perhaps there's a plug-in or some other app that allows you to override the inbox count with the total count?

Unfortunately, searching on Google for anything to do with the inbox count just brings up hundreds of posts about how the count is wrong/not showing. Hard to find anything useful amongst countless pages about bugs.

share|improve this question
    
For pre-Mavericks users, DockStar may solve the issue, but it's no longer supported from Mavericks onwards. –  drfrogsplat Jun 6 at 3:21

3 Answers 3

DockStar solved the issue for me. It now has an update to support both Mavericks and Yosemite when it comes out. I only tested in on Mavericks though, works great.

The great thing for me was that I have exactly 4 inboxes, so I can add a badge for all of them.

share|improve this answer

I would recommend you try this script first.

You can modify the output report to your desire (not email it to your self).

The reason I recommend this is, if you are anything like me and have multiple accounts with hundreds of folders and thousands of emails the badge count could be confusing.

I just run it on my MBA and it took a while but the produced a 3 pages report of ALL emails in all accounts in all folders, while differentiating between read and Unread.

tell application "Mail"
set localMailboxes to every mailbox
if (count of localMailboxes) is greater than 0 then
set messageCountDisplay to "Local mailboxes (On My Mac)" & return & my getMessageCountsForMailboxes(localMailboxes)
else
set messageCountDisplay to ""
end if

set everyAccount to every account
repeat with eachAccount in everyAccount
set accountMailboxes to every mailbox of eachAccount
if (count of accountMailboxes) is greater than 0 then
set messageCountDisplay to messageCountDisplay & return & "Mailboxes for Account: " & name of eachAccount & return & my getMessageCountsForMailboxes(accountMailboxes)
end if
end repeat

set outputMessage to make new outgoing message with properties {content:messageCountDisplay, subject:"Message counts for all my mailboxes", visible:true}
tell outputMessage
set font to "Courier"
set size to 12
end tell
end tell

on getMessageCountsForMailboxes(theMailboxes)
-- (list of mailboxes)
-- returns string

set displayString to ""

tell application "Mail"
repeat with eachMailbox in theMailboxes
set mailboxName to name of eachMailbox
set messageCount to (count of (messages of eachMailbox)) as string
set unreadCount to unread count of eachMailbox as string

set displayString to displayString & " " & my padString(mailboxName, 40) & " " & messageCount & " (" & unreadCount & " unread)" & return
end repeat
end tell

return displayString
end getMessageCountsForMailboxes

on padString(theString, fieldLength)
-- (string, integer)
-- returns string

set stringLength to length of theString

if stringLength is greater than fieldLength then
set paddedString to (text from character 1 to character (fieldLength - 3) of theString) & "..."
else -- stringLength is less than or equal to fieldLength
set paddedString to theString

set paddingLength to fieldLength - stringLength
repeat paddingLength times
set paddedString to paddedString & space
end repeat
end if

return paddedString
end padString

Source:

Here is a snippet of what it looks like (me blocking my personal information)

mail count

share|improve this answer

In system preferences, go to Notifications. Click on the Mail application, then check the box to the right that says "badge app icon." That's it. Just worked for me.

share|improve this answer
    
That just shows the unread count, not all messages in the inbox. –  Scott Earle Jul 27 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.