Re: Entourage vX: every Message whose category is not "Work"
Re: Entourage vX: every Message whose category is not "Work"
- Subject: Re: Entourage vX: every Message whose category is not "Work"
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Mar 2004 18:17:35 -0800
On 3/3/04 4:59 PM, "Jason Bourque" <email@hidden> wrote:
>
I am having a darn time trying to make this work. Any ideas?
>
>
tell application "Microsoft Entourage"
>
tell folder vItemNth
>
>
set vEmailList to every message whose category is not "Work"
>
>
end tell
>
end tell
Note that you seem to be looking for a category property to be a string
("Work"): that's just the name of the category. But there's more to it than
that:
If you look at the dictionary for message (or event, or task, etc.) you'll
see that the 'category' property has the type 'list'. that's because an
object can have several categories. It's unfortunate (and since regretted by
the developer) that this property was not called 'category list' instead of
category, to avoid the confusion with the _class_ 'category'. That category
list property can have any number of category (objects), or none, as the
items of the list. E.g..:
{category "Work", category "Play", category "Fiddle-dee-dee"}
And it's not only scripters who get confused - AppleScript can too. Even
using the "correct" syntax:
set vEmailList to every message whose category does not contain
{category "Work"}
may give you the wrong answer (namely, {} every time). You need an 'its' to
tell AppleScript that it's the messages' category property, not the
application's category class (element) that you want:
set vEmailList to every message where its category does not contain
{category "Work"}
That's what works. Note that absolutely need the correct syntax of a list on
each side of the 'contains' operator. if you forget, and write the more
English-like:
set vEmailList to every message where its category does not contain
category "Work" -- no list braces
it will not get coerced to list. Instead you get the lovely error:
"Can't make <<class cCtg>> into a vector."
Use the list braces.
--
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.