Re: Mail to Address Book script
Re: Mail to Address Book script
- Subject: Re: Mail to Address Book script
- From: Michelle Steiner <email@hidden>
- Date: Sat, 25 Jun 2005 08:42:42 -0700
On Jun 25, 2005, at 8:14 AM, Patrick Collins wrote:
Ok... Say I have an email that says in the body:
Name - Patrick Shmatrick
Email - email@hidden
Email repeat - email@hidden
City - New Kensington
State - pa
Comments
I love your company.. can I work there some day? This is a fake
comment.
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. *)
end if
end repeat
end tell
{name_item, email_item, email_confirm, city, state, comments}
--> {" Name - Patrick Shmatrick", " Email -
email@hidden", " Email repeat - email@hidden",
" City - New Kensington", " State - pa"}
--
Velveeta is to American cheese as American cheese is to cheese.
_______________________________________________
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