• 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: Mail to Address Book script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail to Address Book script


  • Subject: Re: Mail to Address Book script
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 25 Jun 2005 08:44:23 -0700


On Jun 25, 2005, at 8:14 AM, Patrick Collins wrote:

What is the best approach to capture first & last name, email, city,
state, comments into variables that can then be pasted into a new card
in address book?

A slight modification to speed up the script quite a bit, depending on whether there is anything in he message following the comments:


tell application "Mail"
set theMsg to the selection
set the_content to content of item 1 of theMsg
(* If there is a way to use a whose construct with the contents, I can't figure it out*)
set flag to false
repeat with this_item in paragraphs of the_content
if this_item contains "Name - " then
set name_item to contents of this_item
else if this_item contains "Email - " then
set email_item to contents of this_item
else if this_item contains "Email repeat - " then
set email_confirm to contents of this_item
else if this_item contains "City - " then
set city to contents of this_item
else if this_item contains "State - " then
set state to contents of this_item
else if this_item contains "Comments" then
--set comments to contents of this_item
(* The comments line doesn't work because the comments themselves are on the next line, but I think this will get you started. All you need is to extract the exact data from each variable, and figure out how to get the comments. *)
exit repeat
end if
end repeat
end tell


--
Peter pull at St. Taffy's tonight! (Or is it the other way around?)

_______________________________________________
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


References: 
 >Re: Mail to Address Book script (From: "Patrick Collins" <email@hidden>)
 >Re: Mail to Address Book script (From: Michelle Steiner <email@hidden>)
 >Re: Mail to Address Book script (From: "Patrick Collins" <email@hidden>)

  • Prev by Date: Re: Mail to Address Book script
  • Next by Date: path to as unicode text
  • Previous by thread: Re: Mail to Address Book script
  • Next by thread: Re: Mail to Address Book script
  • Index(es):
    • Date
    • Thread