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

Vacation script


  • Subject: Vacation script
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 25 May 2005 11:06:57 -0700

Could I get some feedback on the script itself, and on the release notes and copyright statement?

Thanks.

-- Michelle

using terms from application "Mail"
    on perform mail action with messages theMessages ¬
        for rule theRule
        tell application "Mail"
            repeat with thisMessage in theMessages
                set sender_ to sender of thisMessage
                set name_ to extract name from sender_
                set address_ to extract address from sender_
                set fn to first word of name_
                set ln to last word of name_
                tell application "Address Book"
                    set new_contact to make new person
                    tell new_contact
                        set first name to fn
                        set last name to ln
                       make new email at beginning of emails ¬
                            with properties ¬
                            {label:"other", value:address_}}
                    end tell
                    add new_contact to group "vacation"
                    save addressbook
                end tell
            end repeat
        end tell
    end perform mail action with messages
end using terms from


Release notes

This script is run from a mail.app rule. Place it in/Library/Scripts/ Mail Scripts/Rule Actions/Vacation script.scpt.

Create an Address Book group named "Vacation"
Set up a rule (name it "vacation") with the following characteristics:

If Sender is not a member of group "vacation"
Perform the following actions:
Reply to message
Run Applescript /Library/Scripts/Mail Scripts/Rule Actions/Vacation script.scpt


Make sure this rule is after all the rules that operate on mailing lists (and that the last of them of them has "stop evaluating rules" as its last item--other rules can also have this action, but the last one must have it) so that it will not send vacation mail in response to mail sent to mailing lists.

Copyright ® 2005 by Michelle A. Steiner. You may distribute this script freely, so long as you do not charge for it, and you retain these release notes and copyright notice. You may not include it in a compilation of files for which you charge a fee. You may not distribute it in run-only mode.

--
A great Idea!  That's what we need--a great idea.
 --Pesudolous, (A Funny Thing Happened on the way to the forum)

_______________________________________________
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


  • Prev by Date: Re: Where are good places to publish scripts
  • Next by Date: Re: Scripting the Screen Saver
  • Previous by thread: Re: Where are good places to publish scripts
  • Next by thread: Re: Folder actions steal UI focus
  • Index(es):
    • Date
    • Thread