I'm new to Applescript, trying to do a basic script that gets called from a mail Rule.
Im stuck on getting the subject. There doesnt seem to be one available.
using terms from application "Mail" on perform mail action with messages theMessages for rule theRule tell application "Mail" repeat with aMess in theMessages try set subj to subject of aMess (* aMess has only one property, "contents" = message 1 of mailbox "Incoming POP Messages" of account id "CD180EE3-9A52-4623-BBF0-F722556AF94A" *) if subj is "" then error on error errMsg (* errMsg is osascript got an error: Can’t get subject of message 1 of mailbox "Incoming POP Messages" of account id "CD180EE3-9A52-4623-BBF0-F722556AF94A". clearly it cant get subject because it has only "contents" property How to get the actual email and it's values ? *) set subj to errMsg end try display dialog "The Subject is " & subj end repeat end tell end perform mail action with messages end using terms from
How to get the actual email and it's values ?
I thoguht that was automatic in the loop for each item.