set theMailingLists to every contact where its category contains {category "Mailing Lists"}
I am a beginning AppleScripter, but a long-time programmer, and I'm having a little problem.
I am trying to get the group of contacts that has the Category "Mailing Lists" with this code:
tell application "Microsoft Entourage"
set theMailingLists to every contact whose categories contains {category "Mailing Lists"}
display dialog "Mailing Lists: " & (count of theMailingLists)
end tell
This code runs, but returns a count of 0.
[1] 'category' property of contact (or any other object supporting it) is singular, and is a list of [application] categories.
[2] Because 'category' is the name both of a class and a property, it needs 'its' when specifying the property in a 'whose' clause - or the specific 'of [some object]' in other circumstances - so that AppleScript doesn't get confused. That necessitates 'where its' here instead of 'whose'.
No problems here.
When I do something like this:
tell application "Microsoft Entourage"
set theMailingLists to every contact whose company name � “”
display dialog "Mailing Lists: " & (count of theMailingLists)
end tell
I do get a count. This tells me that I have something wrong with how I am specifying the category.
That's because the documentation is not good. It just gives the bare dictionary definition again.
Can someone point me in the right direction? I’ve read through the Entourage dictionary and the Word document that describes the AppleScript interface, but it didn’t do anything for me.
--
Paul Berkowitz
