Title: Re: Only display threads I've participated
On or near 6/23/04 4:49 AM, Peter Gutbrod at [EMAIL PROTECTED] observed:

> I'd like to display only threads of one or several mailing lists, in which I
> have participated yet, e.g. which I have initiated or to which I have
> replied. But I want not only see my messages but all messages in those
> threads.
>
> I this possible with Erage 2004?
>
Let's see: detecting "is in reply to me" can be done easily in a rule, but only with difficulty in a script, and not at all with Advanced Find. So, perhaps we could set up a category of "Thread I'm in", and have a rule that sets that category as messages come in. (Uncheck “Do not apply other rules...” so this does not prevent further sorting into folders and such.) This gives us something to start with. Give the category a distinctive color and it will help spot things visually.

Now, perhaps, we could do a script that finds any message in a folder that is in "Thread I'm in" category, extracts its subject, locates all other messages in the folder with that subject, and assigns the same category to them all. (Conceivably, it might be enough to set the category for any messages linked to this one, since replies are linked to their original; if we did the change for all of a subject, we'd want to save a list of subjects we'd already processed so we would not duplicate the assignment unnecessarily.) In fact, the same rule that assigns the category to the incoming message could perform that task...but probably not, because it might not yet be in its destination folder with the other messages.

And finally, a fast filter on the folder, category is "Thread I'm in", and we're there, displaying only threads I've participated in.

Here is a script that will operate on selected message(s) and will assign the “Thread I’m in” category (which you must predefine) to all messages with the same subject—if the selected message has that category! I tested it minimally; it seems to work. Let me know if you run into trouble with it.

tell application "Microsoft Entourage"
    
    -- get the currently selected message or messages
   set selectedMessages to current messages
   
    -- if there are no messages selected, warn the user and then quit
   if selectedMessages is {} then
       display dialog "Please select a message first and then run this script."
        return
   end if
   set pastSubjects to {}
    repeat with theMessage in selectedMessages
       set catList to theMessage's category
       if {category "Thread I'm in"} is in catList then
           set s to subject of theMessage
           if s is not in pastSubjects then
               set theFolder to storage of theMessage
               if s begins with "re: " or s begins with "fw: " then set s to text 5 thru -1 of s
               set otherMsgs to (every message of theFolder whose subject contains s)
                repeat with aMessage in otherMsgs
                   set itsCategories to category of aMessage
                   set itsCategories to {category "Thread I'm in"} & itsCategories
                   set category of aMessage to itsCategories
               end repeat
               copy s to end of pastSubjects
           end if
       end if
   end repeat
end
tell

Reply via email to