> From: Paul Berkowitz <[EMAIL PROTECTED]>
> Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
> Date: Fri, 03 Nov 2000 11:39:18 -0800
> To: Entourage mac Talk <[EMAIL PROTECTED]>
> Subject: Re: Scripting question about category
>
> On 11/3/00 7:06 AM, "Allen Watson" <[EMAIL PROTECTED]> wrote:
>
>> I've been trying to enhance my script to find duplicate contacts to create a
>> version that will locate all contacts, assign them a special category, and
>> then finish with that set of contacts "found" in the Address Book. I have
>> all but the last step working.
>>
>> Does anyone (Paul, Dan) know a way to script finding contacts by category? I
>> want to do the equivalent of:
>>
>> Set dupes to every contact whose category is "Possible Duplicate"
>
> Yup! that was in my first (or maybe second) "report on Entourage scripting"
> which you said you were going to keep and refer to!
I said I would keep it. I don't think I ever promised to READ it! ;-) But I
will now! Actually, I've just searched everywhere for it and cannot find it!
I even went to the e-talk archives and it isn't that, at least not searching
on "Entourage scripting". Could you re-post your report to the whole list,
so it makes it to the archive, with a subject of "Report on Entourage
scripting"? Thanks.
> As you've just
> discovered for yourself, Dan never implemented whose clauses for category
> property of contact (bug). You have to do it by a repeat loop:
>
> tell application "Microsoft Entourage"
>
> set theContacts to every contact
>
> set catContacts to {}
>
> set catName to "Possible Duplicate"
>
> set n to (count theContacts)
>
> repeat with i from 1 to n
> set theContact to item i of theContacts
> set nCategories to get theContact's category
> if nCategories contains {category catName} then set end of
> catContacts to theContact
> end repeat
>
> catContacts
>
> end tell
>
Ugly! And very slow. For now, the better method is as you suggest, one of:
1. Instruct the user to manually filter on category "Possible Duplicate".
2. Instruct the user to provide a custom view called "Candidates in Possible
Duplicate category", and then try to open it; if that fails, then just tell
then to filter for the category themselves (method 1).
>
> You can't script properties for a new custom view, so that's out.
>
Now, there is something we ought to request!!
> You can do a custom view without a script of course. Just make a new custom
> view setting the Item types to <Contacts> and setting the criteria to
> <Category> is "Possible Dupes>.
>
> If you first just make a Category "Possible Dupes", and make a "Contacts in
> the Possible Dupes Category" as above, even with no one in it, all you have
> to do is
>
> open custom view "Possible Dupes"
>
> and it will open with the contacts on view as most recently set by your
> script.
>
> Does this help?
>
Sorta. I was afraid that I had found an omission, and apparently I did. Bill
Cheeseman's post was interesting in that regard also, wasn't it?
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984
My web page: <http://home.earthlink.net/~allenwatson/>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>