• 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: setting-up Mail rules and execute-applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting-up Mail rules and execute-applescript


  • Subject: Re: setting-up Mail rules and execute-applescript
  • From: Bill <email@hidden>
  • Date: Mon, 3 Nov 2003 10:48:22 +0800

Do you know a way to create a new rule in Mail, whose only action is execute
an applescript?

Julifos,

Try this one:
-- The POSIX path of the complied applescript file
set x to POSIX path of ((path to scripts folder from user domain) as Unicode text) & "Mail Scripts:report spam to netvigator.scpt"

tell application "Mail"
-- make a new rule, set the description and actions to be performed
set newRule to make new rule at end of rules with properties {name:"report spam to ISP", all conditions must be met:true, run script:x}

-- The first rule condition must be made at the beginning
make new rule condition at beginning of newRule with properties {rule type:message is junk mail}
-- one more condition
make new rule condition at end of newRule with properties {expression:"email@hidden", rule type:any recipient, qualifier:does contain value}
-- enable the rule
set enabled of newRule to true
end tell


Tested on Panther, Mail 1.3 :)


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: setting-up Mail rules and execute-applescript
  • Next by Date: Odd disk numbers in 10.3
  • Previous by thread: Re: setting-up Mail rules and execute-applescript
  • Next by thread: Re: setting-up Mail rules and execute-applescript
  • Index(es):
    • Date
    • Thread