Re: setting categories in Entourage X
Re: setting categories in Entourage X
- Subject: Re: setting categories in Entourage X
- From: Sven Ryen <email@hidden>
- Date: Tue, 25 Jun 2002 10:10:29 +0200
On 25.06.2002 09:20, "Paul Berkowitz" <email@hidden> wrote:
I'll <SNIP> your excellent points on how to properly put together a list of
categories, and provide a helpful tip on how to read the Entourage
dictionary, plus a way of figuring out the syntax for the properties of new
Entourage items when you're really stuck.
Let's start with the 'note' entry in the Dictionary:
Class note: A note
Plural form:
notes
Properties:
<SNIP>
category a list of reference -- the list of categories
<SNIP>
The clue here is "reference". Garrett, if Entourage were to expect a list of
names, it would say "a list of category name", which it does not.
So, great, we know Entourage is expecting references, but what do a list of
references look like? Well, if we're that much in doubt, we could always
create a note with some categories already assigned, then read its list of
categories in a script. Let's do that: (Be sure the item selected has
categories, and that whatever selected is not a string of text.)
tell application "Microsoft Entourage" to set categoryList to category of ,
item 1 of (get selection)
The result will end up in the Event Viewer:
--> {category id 14, category id 4}
There we go, our list of references. The good thing with these references is
that you can set and get them in the same manner. Read them in from a
contact, and you can instantly apply the entire list of categories to a note
without converting the list at all.
Paul responded:
>
set categoryList to category of theContact --get the contacts categories
>
set end of categoryList to category theCategory_SerialNumber_Name
>
set category of theContact to categoryList
Are you sure that's what Garrett wanted, Paul? To me, it seemed like he
wanted to create a note without modifying the categories of the selected
contact/whatever.
Let's add the last category to categoryList:
set end of categoryList to category named theCategory_SerialNumber_Name
As you see, you can't just append the category name, you'll have to create a
reference to the "category named theCategory_SerialNumber_Name".
So, skip the loop, simply add a reference to the extra category at the end
of the categoryList, and you'll be all set.
Cheers,
Sven Ryen
--
Phone. +47 6113 4486 - mob. +47 9979 8717 - <
http://www.maxus.no/>
_______________________________________________
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.