PDA

View Full Version : Auto-reply script not working


antron
05-15-2009, 03:25 AM
I am calling below code from a Mail.app rule:


using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
try
set replyMessage to reply eachMessage without opening window
set theSubject to "foundme"
set theBody to "You have hit the right spot"
send replyMessage
end try
end repeat
end tell
end perform mail action with messages
end using terms from


However nothing happens, and I see the following in the console log:

5/15/09 5:04:06 PM Mail[4943] *** Assertion failure in -[MailDocumentEditor load], /SourceCache/Mail/Mail-935/Compose.subproj/DocumentEditor.m:322
5/15/09 5:04:06 PM Mail[4943] An exception was thrown during execution of an NSScriptCommand...
5/15/09 5:04:06 PM Mail[4943] load must be called on the main thread
5/15/09 5:04:06 PM Mail[4943] load must be called on the main thread
5/15/09 5:04:25 PM Mail[4943] *** Assertion failure in -[MailDocumentEditor load], /SourceCache/Mail/Mail-935/Compose.subproj/DocumentEditor.m:322
5/15/09 5:04:25 PM Mail[4943] An exception was thrown during execution of an NSScriptCommand...
5/15/09 5:04:25 PM Mail[4943] load must be called on the main thread

Red_Menace
05-15-2009, 04:37 PM
In Leopard's Mail, you can't send a message from a rule script - see http://forums.macosxhints.com/showthread.php?t=98366