vacation mail revisited
vacation mail revisited
- Subject: vacation mail revisited
- From: Ed Wiederer <email@hidden>
- Date: Sat, 2 Apr 2005 15:25:16 -0500
A while back, Michelle Steiner had posted a pretty useful script for auto-responding to mail while on vacation, which I borrowed liberally from. The only reason to use this script instead of just using Mail's rules is that there is no option in Rules to filter for a sender who is NOT a member of an Address Book group, and as in the case of the vacation mail, I don't want to repeatedly send the same message to the same people.
I have found, as Michelle reported back in April, that the script works brilliantly when called from the Script menu in the toolbar, or even when manually applying rules to a message (Message\Apply Rules or cmd-L), but it didn't seem to work automatically (i.e. when I am away from the computer and a message meeting the rule criteria comes in). I think I have detected the problem, but have no idea how to fix it -- in the script,
messages_to_process is defined as
the selection, and I've noticed that my rule-script combination is sending out an automatic response, only it is to the sender of whatever message happened to be selected last in my inbox, not the new messages that just activated the rule. So, the question is, how to set the
messages_to_process to be the new incoming message(s).
Anyway, here's the entire script, but I'm pretty sure my problem is in the third line...
using terms from application "Mail"
tell application "Mail"
set the messages_to_process to the selection
perform mail action with messages messages_to_process for rule "phaseout"
repeat with message_to_process in messages_to_process
set the_sender to the sender of the message_to_process
set the_reply_message to reply the message_to_process
set the sender of the_reply_message to "myemail@myISP"
set the subject of the_reply_message to "Re: " & the subject of the message_to_process & " (Automatic response)"
set the content of the_reply_message to "Automatically generated message from me about my old and new e-mail accounts"
send the_reply_message
--this next bit forwards the message to my new account, mostly so that when I'm at a different location, I can verify that these messages are being caught and auto-responded to--
set ccToEd to forward the message_to_process
set theName to "Ed Wiederer"
set theAddress to "myemail@myISP"
tell ccToEd
make new to recipient at end of to recipients with properties {theName, theAddress}
set the subject of ccToEd to "SENT NOTIFICATION: " & the subject of the message_to_process
set the content of ccToEd to the content of the message_to_process
end tell
send ccToEd
my extract address from the_sender)
end repeat
end tell
end using terms from
on email_sender)
using terms from application "Address Book"
tell application "Address Book"
set the newbie to make new person at after the people of group "netwayremind"
make new email at after the emails of the newbie with properties {label:"reminded", email_sender}
save addressbook
end tell
end using terms from
end addtogroup _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden