On or near 2/4/01 11:47 PM, Jammer Six at [EMAIL PROTECTED] observed:
> I need to do 2 things with this email:
>
> 1. Make a new contact, capturing name, address, zip, phone, email, and Job
> Number.
>
> This contact would always be of category "Lead", and I have a custom field
> set up in Entourage for the Job Number. It is called "Lead Source", and if
> there's a Job Number there, I know the lead came from ServiceMagic.
>
> 2. Make a Task, which would always be named "Call for initial appointment",
> would always have "Highest" as a priority, and would always be linked to the
> new contact.
All of this is quite feasible. However, it will take a fair amount of custom
programming (or scripting, whichever we call it). I don't think it's really
fair to ask anyone to do this <for> you, unless you want to pay them.
There are a number of scripts you can download from AppleScript Central, for
instance, which contain examples of how to do the various pieces of what you
need, for the most part: making a contact, setting its category, filling in
fields, creating a task, and linking the task to the contact. With a little
effort, you should be able to pull all those pieces together.
There is a scripting guide for Entourage you can download to give you some
further assistance (on the Mactopia web site).
The front end to your job will be parsing out the E-mail to get the
information you want to store in various fields. The following is a template
that might be useful; it shows how to parse a message looking for the
"Customer Name:" label and extracting the name information into a variable,
"cName".
tell application "Microsoft Entourage"
set msgs to the current messages
set theMsg to item 1 of msgs
set theContent to content of theMsg
set graphs to every paragraph of theContent
set od to AppleScript's text item delimiters
set AppleScript's text item delimiters to ": "
set cName to ""
repeat with aLine in graphs
if aLine begins with "Customer Name :" then
set cName to text item 2 of aLine
exit repeat
end if
end repeat
set AppleScript's text item delimiters to od
cName
end tell
Running that against your message, I get:
"Mixxxxx Cxxxx"
If you were searching for multiple fields, as you would be, you could simply
have a separate "if/end if" block for each field, and remove the "exit
repeat" statement. This would let the script loop through every line of the
message, picking out the lines that match field names. You would then use
these fields to create your contact records and such.
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage:
<http://homepage.mac.com/allenwatson/>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>