Re: "Run Applescript" rule
Re: "Run Applescript" rule
- Subject: Re: "Run Applescript" rule
- From: Bill <email@hidden>
- Date: Mon, 27 Oct 2003 21:25:45 +0800
In Panther, when a rule runs an applescript, how does the script know
which message triggered the rule? In Claris Emailer, "the filtered
message" in the script identifies the message.
Michelle,
Suppose you're talking about Mail.app, there's a sample script "Sample
Rule Action Script.scpt" in the folder /Library/Scripts/Mail
Scripts/Rule Actions/. You may option click, and open it from
Mail.app's own script menu.
Last weekend, I used this script as foundation and composed this one;
to report spam mail to my ISP:
using terms from application "Mail"
on perform mail action with messages theMessages
tell application "Mail"
set reportFrom to "email@hidden"
set reportTo to "email@hidden"
repeat with eachMessage in theMessages
set theSubject to "FORWARD SPAM: " & subject of eachMessage
set theBody to source of eachMessage
try
set newMessage to make new outgoing message with properties
{subject:theSubject, sender:reportFrom, visible:false, content:theBody}
tell newMessage to make new to recipient at end of to recipients
with properties {address:reportTo}
send newMessage
end try
end repeat
end tell
end perform mail action with messages
end using terms from
Hope this information helps you.
bill
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.