Under 10.1 and earlier, a lot of people had a tough time scripting Mail.app because there was no way to check for new mail.
I just wanted to point out, in case anyone missed it, that this has been fixed under 10.2. Mail now understands the command "check for new mail" in AppleScripts. Pretty cool.
