I’m having a problem composing an email through an applescript in 10.7 which worked in 10.6 but doesn’t in 10.7. But now I get an error.
set the_mailto to "emai1@email.com"
set the_Account to "yourAccountOfChoice@mail.com"
set the_subject to "subject"
set the_content to "content"
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {sender:the_Account, address:the_mailto, subject:the_subject}
end tell
set the_mailto to "emai1@email.com"
set the_Account to "yaddah@baddah.com"
set the_subject to "subject"
set the_content to "content"
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {visible:true, subject:the_subject, content:the_content, sender:the_Account}
tell newMessage to make new to recipient at the end of to recipients with properties {address:the_mailto}
end tell
maybe this works? I added the visible:true property so I could see the result
I have a problem too with Mail in 10.7. The “content” property produces an error:
tell application “Mail”
set myMessage to make new outgoing message with properties {subject:“Mike”, visible:true}
tell myMessage
set the content to “Testing”–It fails here
end tell
end tell
I get “AppleEvent Handler failed” at the “set the content…” line. It makes no difference whether I try to enter the content as above, or as a property in the “set myMessage…” line.
The script runs OK in 10.6, so either it’s a bug in 10.7, or possibly I’ve got an incompatible osax which also defines “content”. Any ideas? Could some kind person please try this on their 10.7 and see what happens?
Thanks
Mike
Model: MacBookPro Core 2 Duo
AppleScript: Lion
Browser: Safari 5.1
Operating System: Other