This piece of a script worked before Tiger and Mail version 2.0. The intent was to select a particular message to send, wait until it was sent and then quit the mail application.
Unless the message is extremely short, most of the time Mail quits before the message has finished sending and I have to restart Mail to get it to complete.
Is there a more appropriate way to wait for the send action to complete? Does the "Out" mailbox even exist anymore in Mail?
The script piece:
tell application "Mail" set msgList to outgoing messages repeat with msg in msgList if subject of msg is thedate then set msgID to msg exit repeat end if end repeat send msgID repeat until (messages of mailbox "Out" is {}) tell application "System Events" to do shell script "sleep 5" end repeat quit end tell
|