Hello all! I have a (probably dumb) question: I'd like to write a simple applescript that would force mail to check for new mail and then tell me how much unread messages i have. This is what i've done so far (not much
):
The code works but it seems that the script doesn't wait until Mail.app finishes checking for new mail, so when I receive new messages, the script still reports 0. What can I do?
Code:
tell application "Mail"
check for new mail
set unreadMailCount to unread count of inbox
end tell
say "Unread messages: " & unreadMailCount as text
The code works but it seems that the script doesn't wait until Mail.app finishes checking for new mail, so when I receive new messages, the script still reports 0. What can I do?
Last edited: