In this AppleScript on Mavericks:
tell application "Mail" activate set viewer to the first message viewer set msgList to selected messages of viewer end tell set msgCount to 0 repeat with m from 1 to the count of msgList set msgCount to msgCount + 1 end repeat
I get a much higher message count than the number of selected messages (it can be a difference of almost 30% for some mailboxes). I have confirmed that selecting ONE message with no replies can result in the message being counted more than once. This is with a standard IMAP account.
Is there any reason other than IMAP errors for this discrepancy?