Mail.app Rule to copy subject and body to a new message?
Mail.app Rule to copy subject and body to a new message?
- Subject: Mail.app Rule to copy subject and body to a new message?
- From: Steve Hahn <email@hidden>
- Date: Thu, 03 Mar 2011 15:32:14 -0800
I'm very new to Applescript so I'm hoping I can get some help. I'm
trying to write a script that would be called by a rule in Mail.app.
The script would take the message that invoked the rule and copy its
subject and body into a new message that would be sent to another
email address (the ultimate purpose of this would be to have certain
messages sent to Remember the Milk to be imported as tasks--if I can
get this script working, the tasks as imported won't have "Fwd:" in
the task name and won't have "Begin forwarded message" and all that in
the task notes).
Here's what I have so far, shamelessly cobbled together from other
scripts I've found around the web:
************
on perform_mail_action(theData)
tell application "Mail"
set theSelectedMessages to |SelectedMessages| of theData
set theRule to |Rule| of theData
repeat with eachMessage in theSelectedMessages
set theMessage to item 1 of theSelectedMessages
set captioMessage to make new outgoing message at end of outgoing messages
tell captioMessage
make new to recipient with properties {address:"[my Remember the Milk
email address]"}
set content to theMessage's content
set subject to theMessage's subject
end tell
send captioMessage
end repeat
end tell
end perform_mail_action
*******************
I'm obviously missing some crucial piece here, because when the script
is invoked it doesn't act on the message that matched the rule that
called the script, it acts on whichever message happens to be
highlighted in Mail.app's Inbox. If no message is highlighted, the
script does nothing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden