Hello,
I wonder why I cannot find any information on google regarding these problems, as I think it should be quite a common task for scripting:
I wanted an applescript to:
- reply a selected message
- change the subject appending a certain word
Should be easy, isnt it?!
Well, look at this
tell application "Mail"
set sel to selection
set theMessage to the first item of sel
set theReply to reply theMessage
get subject of theReply
end tell
Error: The variable theReply is not defined.
Uhuh, well, so it sort of looses the reference to the fresh reply.
No problem, let´s get it through “outgoing messages”:
tell application "Mail"
set outMes to outgoing messages
get outMes
end tell
result: {application “Mail”, application “Mail”, application “Mail”, application “Mail”, application “Mail”}
Dont even try to access something like “get subject of firrst item of outMes” or the like.
I cannot even think of what happened here.
Very interesting. The only way to get a veritable “outgoing message” seems to be to “set foobar to make new outgoing message with blabla” BUT this will not work for assembling a reply because you cannot get the content of the selected message if there is anything but plaintext in it.
Uhm, Apple, excuse me, are you guys at the mail.app department smoking to many iPots or something?
Anybody any help? Thanks a lot in advance …
AppleScript v1.10
Mail.app 2.0.3
Mac OS 10.4.2
lucas