Entourage: Obtaining items where the item's every category is contained in a list
Entourage: Obtaining items where the item's every category is contained in a list
- Subject: Entourage: Obtaining items where the item's every category is contained in a list
- From: "Patrick Gerzanics" <email@hidden>
- Date: Mon, 19 Jan 2004 10:30:01 -0600
Hello. I'm finding it difficult to accomplish something like the following
in a single query. Perhaps it is not possible? Regardless, here goes (This
was all typed in an e-mail editor, so typos probably exist but should not
change the logic I utilize):
tell application "Microsoft Entourage"
set eventList to {}
set tempList to every event
set categoryList to {category "Personal", category "Family", category
"Holiday"} --example category list
repeat currEvent in tempList
tell currEvent
set allFound to true
repeat currCategory in category
if (currCategory not in categoryList) then
set allFound to false
end if
end repeat
end tell
if (allFound) then
set currEvent to end of eventList
end if
end repeat
end tell
I'd like to accomplish this in a single query, essentially returning all
items where 'every' category of the item is contained in the list. The
important thing is that categoryList is of variable length and changes
depending on parameters to the script so I can't hard-code it.
I've tried:
set eventList to every event where its category is contained in categoryList
But this only returns events where its 'primary' category is in the
categoryList, not every category.
Any suggestions for how to do this?
Thanks for any and all assistance!
-Patrick
_______________________________________________
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.