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

Re: Vacation Mail script


  • Subject: Re: Vacation Mail script
  • From: Andreas Amann <email@hidden>
  • Date: Thu, 25 Mar 2004 20:49:49 -0800

Unfortunately, and unlike other email programs such as the late lamented Claris Emailer, the sender is plain text, without distinguishing between the sender's name and email address, so I have to parse out the address itself.

Well, if you are using 10,3 or higher, you can simply use

--
tell application "Mail" to set email_sender to extract address from sender_string
--

Furthermore, in order not to have duplicate addresses in the group and have the group grow beyond control you probably might want to check whether the address is already present:

--
on add_to_list(email_sender)
tell application "Address Book"
if (count of (people of group "Vacation" whose value of emails contains email_sender)) = 0 then
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 if
end tell
end add_to_list
--

Andreas
_______________________________________________
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: passing variable in forms on the internet using applescript
  • Next by Date: Re: AppleScript & HTML Again...
  • Previous by thread: Re: Vacation Mail script
  • Next by thread: Re: Vacation Mail script
  • Index(es):
    • Date
    • Thread