Is there a way to capture and "use" the subject from the Apple Mail and use that in an Applescript?
I want to have try to get rid of some triggers (and learn to use AppleScript). I want to have a single script run when the email's sender is the alarm system (
ourhouse@alarmco.com) but would like to use some nested if/then/else statements in lieu of individual triggers....
I'd have a rule in Apple Mail that would scan the email from the alarm company's email address, then if the subject of that email also contained "Disarmed" then activate a single AppleScript
tell application "IndigoServer"
If value of variable "EMailSubject" contains "William"
set value of variable "AlarmSet" to "False" as boolean
set value of variable "AlarmDisarmedBy" to "Bill" as string
Else
If value of variable "EMailSubject" contains "Patricia"
set value of variable "AlarmSet" to "False" as boolean
set value of variable "AlarmDisarmedBy" to "Aunt Pat" as string
Else
set value of variable "AlarmSet" to "False" as boolean
set value of variable "AlarmDisarmedBy" to "Unknown" as string
End if
End if
End if
end tell
Right now I have separate rules for all three situations and I'm using this to reduce triggers and get a better understanding of AppleScript.
But--is there a way to grab the subject of an incoming email? All the stuff online (here and other places I've googled is for setting the subject of outgoing emails...