• 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
Vacation mail script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Vacation mail script


  • Subject: Vacation mail script
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 31 Mar 2004 16:40:18 -0700

I got to thinking about vacation mail, and realized that the rule and script would send vacation-mail notification to the "originators" of junk mail, and that's not a good thing.

Unfortunately, although mail rules have a "message is junk mail" criterion, it does not have a "message is not junk mail" criterion, so the rule can't be changed to eliminate junk mail from consideration.

Fortunately, the junk mail flag is accessible to Applescript, so I was able to modify 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
if junk mail status of message_to_process is false then
set the_sender to the sender of the message_to_process
my add_to_vacation(extract address from the_sender)
end if
end repeat
end tell

to add_to_vacation(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_vacation

--
"There's some good in the world, Mr. Frodo, and it's worth fighting for."
_______________________________________________
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.


  • Follow-Ups:
    • Re: Vacation mail script
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Copy image to clipboard
  • Next by Date: Re: Copy image to clipboard
  • Previous by thread: Re: Vacation Mail script
  • Next by thread: Re: Vacation mail script
  • Index(es):
    • Date
    • Thread