Hi Everyone!
I’m trying to script Mail for the first time and I’m having troubles on what should be pretty straight forward. I’ve assigned an applescript to a rule:
on perform_mail_action(theData)
tell application "Mail"
set messageList to |SelectedMessages| of theData
set mCount to the count of messageList
repeat with i from 1 to mCount
set theMessage to item i of messageList
set theContent to the content of theMessage
set theSubject to the subject of theMessage
try
set theReply to reply theMessage
on error errMsg number errNum
set the result to display dialog errMsg buttons {"OK"}
end try
end repeat
end tell
end perform_mail_action
and when I apply the rule from the menu to test it I get an “Apple event handler failed.” message when theReply message is created. The same thing happens if I try to create a new outgoing message. Any help would be greatly appreciated.