In the following script I seem to be having a problem setting the return address variable myAddress. It is leaving the “To” line empty on the e-mail that is being created.
–set reply variables
set theSubject to “Hello to You”
set theBody to “How are you today??”
–open the mail application
tell application “Mail”
–delete activate when out of debug
activate
–get messages from “test” mailbox
set theMessage to messages of mailbox “test”
–test each message to see if subject=“Hello”
repeat with eachMessage in theMessage
if subject of eachMessage is “Hello” then
–if subject=“Hello” then set the return address to sender of original
set myAddress to sender of eachMessage <----This line is where the problem is I believe
–create the new e-mail
set newMessage to make new outgoing message with properties ¬
{recipient:myAddress, subject:theSubject, content:theBody & return & return}
end if
--delete the next tell block when finished with debugging
tell newMessage
set visible to true
end tell
end repeat
end tell
Any suggestions? Also are there any good sites thaat concern the scripting of mail.app? I did a Google search but did not come up with any good ones. And Apple’s site concerning scripting Mail.app in my opinion SUCKS!!!