• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "Run Applescript" rule
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: OS 9 or Classic, that's the question :-)
  • Next by Date: Panther Bug with Acme Scripting Widgets (Spaces)
  • Previous by thread: "Run Applescript" rule
  • Next by thread: Programming the address book
  • Index(es):
    • Date
    • Thread