Hi All,
Bit new here and my coding is ropey at best. Basically ive got some automated emails that appear in my inbox every 10 mins or so. They have the same subject but different contents. What I want to do is, when the emails come in to take the first line of it then send a new email with the first line as the subject.
So what ive done is to write an applescript which gets triggered on a subject line rule. The script is as follows:
Any help would be much appreciated. As i said earlier not even registering in the console and nothing seems to happen.
Thanks.
Bit new here and my coding is ropey at best. Basically ive got some automated emails that appear in my inbox every 10 mins or so. They have the same subject but different contents. What I want to do is, when the emails come in to take the first line of it then send a new email with the first line as the subject.
So what ive done is to write an applescript which gets triggered on a subject line rule. The script is as follows:
Code:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
set recipientAddress to "example@com.com"
tell application "Mail"
repeat with thisMessage in theMessages
set theText to paragraph 1 of content of theMessage
set theNewSubject to "!-- some text --!" & theText
set theNewMessage to make new outgoing message
tell theNewMessage
make new to recipient at end of to recipients with properties {address:recipientAddress}
set subjext to theNewSubject
set content to theText
end tell
delay 5
send theNewMessage
tell thisMessage
set replied to true
end tell
end repeat
end tell
end perform mail action with messages
end using terms from
Any help would be much appreciated. As i said earlier not even registering in the console and nothing seems to happen.
Thanks.