i am trying to process a Mail message that is literally on its way. i have a rule set so that the subject of this message makes it go straight to a designated custom mailbox. this mailbox is always empty on receipt of this message so i tried something like this:
tell app “Mail”
set message_num to number of messages in mailbox “BlahBlahBlah”
repeat until message_num is greater than 0
check for new mail
end repeat
end tell
it works if run on its own and the message was already there but it doesn’t seem to work if the mailbox starts empty and the new message comes in. is there another command more along the lines of scanning the mailboxes rather than checking for new mail? i think that’s what is messing it up.