Te recomiendo que pruebes primero este script.
Puedes modificar el informe de salida a tu gusto (no enviarlo por correo electrónico).
La razón por la que recomiendo esto es que si eres como yo y tienes varias cuentas con cientos de carpetas y miles de correos electrónicos la cuenta de la placa podría ser confusa.
Lo acabo de ejecutar en mi MBA y me llevó un tiempo pero produjo un informe de 3 páginas de TODOS los correos electrónicos de todas las cuentas de todas las carpetas, diferenciando entre leídos y no leídos.
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
Fuente:
Aquí hay un recorte de lo que parece (yo bloqueando mi información personal)
0 votos
Para los usuarios anteriores a Mavericks, DockStar puede resolver el problema, pero ya no es compatible a partir de Mavericks.