new message counter
Quick Fix for Gmail IMAP-Mail Issues
For those of you who use Gmail IMAP in Mail as I do, you are probably just as annoyed with one thing- the new messages counter always reads twice the actual number. This is because the message is sent to both your inbox and the folder titled “Gmail” or “All Mail”. Just put the following into Script Editor, and voila!
tell application “Mail” set unreadBox to mailbox “[Gmail]/All Mail” of account “Gmail IMAP” set unreadCount to unread count of unreadBox if unreadCount is not 0 then repeat unreadCount times set unreadMail to first message of unreadBox whose read status is false set read status of unreadMail to true end repeat end ifend tell















