Re: Entourage: make new contact
Re: Entourage: make new contact
- Subject: Re: Entourage: make new contact
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 01 Jun 2001 08:02:16 -0700
On 6/1/01 6:15 AM, "Jolly Roger" <email@hidden> wrote:
>
Can someone experienced with scripting Outlook Express / Microsoft Entourage
>
tell me why the following snippet returns no error but does not appear to
>
actually generate a new contact entry?
>
>
-- begin script
>
tell application "Microsoft Entourage"
>
set newContact to make new contact with data {first name:"First", last
>
name:"Last", default email address:"email@hidden", description:"This
>
contact was added via AppleScript."}
>
end tell
>
-- end script
>
>
Interestingly, when the script is complete, <newContact> does contain a
>
reference to the new contact; but if I open the Address Book window and type
>
the name "First" in the filter field, I get zero matches.
>
>
Any ideas?
>
It should be 'with properties', not 'with data'. Although the latter will
compile (the term 'data' is an AppleScript keyword, not an Entourage
keyword) and for some reason does not error in execution (maybe
AppleScript's fault, not Entourage's), it doesn't do anything. You'll find a
completely blank line at or near the top of your address book, just above
the first contact to have a name (if sorted by name), or as many as you made
in this fashion. Delete it (them). If you do it again but track it:
tell application "Microsoft Entourage"
set newContact to make new contact with data {first name:"First", last
name:"Last", default email address:"email@hidden", description:"This
contact was added via AppleScript."}
set {a, b, c} to {last name, first name, name} of newContact
try
set d to contents of email address 1 of newContact
on error
set d to "There ain't no email address either"
end try
open newContact
{a, b, c, d}
end tell
you can confirm your suspicions. Then try:
tell application "Microsoft Entourage"
set newContact to make new contact with properties {first name:"First",
last name:"Last", default email address:"email@hidden",
description:"This contact was added via AppleScript."}
end tell
It's true that none of this is documented anywhere, except that the
Dictionary does specifically refer to each class's 'properties', of course.
I have seen people use the 'with data' format once or twice, even, I think
in OE or something other than a contact, evidently, and wondered about it.
Is it meant to work for all applications (should it have been implemented
here) as a standard AppleScript procedure, or have you just carried it over
from some other app (Emailer?) where it is specifically implemented and
perhaps even included somewhere in the dictionary?
--
Paul Berkowitz