Vacation Mail script
Vacation Mail script
- Subject: Vacation Mail script
- From: Michelle Steiner <email@hidden>
- Date: Tue, 23 Mar 2004 20:02:43 -0700
Vacation mail is nice, but some implementations of it result in
repeated mailings to individuals or lists.
If mail.app would have a rule that would add an address to an address
group, creating one-time vacation mails would be a snap, but it
doesn't--but you can script it to do that.
First set up a rule named "Vacation"; make it the last rule, and ensure
that all rules pertaining to mailing lists precede it, and have have
"stop evaluating rules" as their final rule. This will prevent mailing
list traffic from triggering the vacation rule.
The rule is
If any of the following conditions are met:
Sender is not a member of group Vacation
Perform the following actions
Reply to Message <message text>
Run Applescript <the vacation script>
Here is the script:
tell application "Mail"
perform mail action with messages messages_to_process for rule
"vacation"
repeat with message_to_process in messages_to_process
set the_sender to the sender of the message_to_process
my add_to_list(my parse_the_sender(the_sender))
end repeat
end tell
to add_to_list(email_sender)
tell application "Address Book"
set the newbie to make new person at after the people of group
"Vacation"
make new email at after the emails of the newbie with properties
{label:"Vacation", value:email_sender}
save addressbook
end tell
end add_to_list
to parse_the_sender(sender_string)
set {tid, text item delimiters} to {text item delimiters, {"<"}}
set email_sender to text item 2 of the_sender
set text item delimiters to tid
set email_sender to text 1 through -2 of sender_email
return email_sender
end parse_the_sender
-- Michelle
--
My body is not a democracy: you don't get a vote.
_______________________________________________
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.