Re: setting-up Mail rules and execute-applescript
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.