OK, after looking at the sample scripts I came up with the following:
property SendAddress : "
email@hidden"
property theSubject : "Automated Warning"
property theBody : "Alert: "
property theFrom : "
email@hidden"
tell application "Mail"
set newMessage to make new outgoing message
tell newMessage
set subject to theSubject
set content to theBody
set visible to true
set sender to theFrom
make new to recipient with properties {address:SendAddress}
end tell
send newMessage
end tell
Nifty, the message is created. However, I want to get something out of the subject of the message I am going to be replying to.
For example, let's say the message comes from
email@hidden with a subject of "Automated Warning: <process> not responding" where <process> can be any of a number of things. The text around <process> is predictable.
I want to fire my AppleScript in reply to that message (easy enough with the Rules in Mail.app) and send an SMS that says "Alert: Process"
How do I get that word out of the original subject?