Re: Entourage Contact help
Re: Entourage Contact help
- Subject: Re: Entourage Contact help
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 19 Apr 2002 21:02:46 -0700
On 4/19/02 8:38 PM, "garrett" <email@hidden> wrote:
>
I forgot one last q - what about setting the default email address AND the
>
default category if u have more than one -
>
>
also - can a new task be created from this contact so that it has links?
That's two questions. ;-)
There's no such thing a as a "default" category: the primary category, the
one that sets the color, is simply the first one in the list of categories.
yes, of course you can set it. The 'category' property of contact (and of
event and task and note and a few other things) is actually an AppleScript
list of categories belonging to the application (a bit confusing)
set category of newContact to {category "Work", category "Urgent"}
will give it both categories, with "Work" setting the color. You can include
it as a property when making the contact:
set newContact to make new contact with properties {first name:"Joe",
last name:"Blow", email address:"email@hidden", birthday:"1/1/1904",
category:{category "Work", category "Urgent"}}
(I snuck 'email address' in there to show you that you can actually make the
default email address that way even though 'email address' is an element
rather than a property. To make more than one, you have to do it as you did
earlier.)
'links are read-only properties, so you cant set links to anything nor
include them as properties at inception, as with category. you do it this
way, after making the contact:
link newContact to task "Phone Joe"
(or if you've got more than one task of that name:
set theTask to first task whose name is "Phone Joe" and due date is
greater than (current date) -- or whatever
link newContact to theTask
or:
tell me to set theStartTime to date "1/1/2003" --this format if in
Entourage tell block
tell me to set theEndTime to date "1/2/2003"
set the remind time to (5 * days) -- only in Entourage X, not 2001
set JoesBirthday to make new event with properties {subject:"Joe's
Birthday", start time: theStartTime, end time: theEndTime,
category:{category "Friends"}}
link newContact to JoesBirthday
(now you can get 'links of newContact' and they will include this event).
There's a bug, or limitation, that you can't yet ink to a file on your hard
disk by AppleScript as you can in the UI - you can only link to other
Entourage objects.
--
Paul Berkowitz
_______________________________________________
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.