Title: Re: Confusion over version
On 2/2/02 3:48 PM, I wrote:

          Hey, great idea! The rule, that is. I set up two categories, "E2201" and "EvX" with
          different colors. Then, I stored this script and assigned it with MLM to all the messages
          incoming to the Entourage list. Now the messages show by color what version of Entourage
          was used.
          
          tell application "Microsoft Entourage"
              activate
              set theMess to item 1 of (get current messages)
          
Etcetera

Well, that’ll teach me to make last minute changes before mailing a script without testing! That script won’t work.

Try this instead. This version also includes a third category, “Unknown client”,  for messages whose headers do not indicate what client sent the message. I’m not sure what will happen if this is run on a script sent from Eudora, Power Mail or some such...but on the Entourage list that isn’t too likely.

Also, this version now can be run on multiple messages when selected in a folder, so you can quickly categorize all the messages in your current Entourage folder.

tell application "Microsoft Entourage"
    activate
   set
allMsg to current messages
   repeat with
theMess in allMsg
       set theHeaders to headers of theMess
       set headerType to "User-Agent: "
        if
headerType is not in theHeaders then set headerType to "x-mailer: "
        if
headerType is not in theHeaders then
           set
versionDigit to "0"
        else
           set
theHeaders to the paragraphs of theHeaders
           set theHeader to ""
            repeat with
aHeader in theHeaders
               if aHeader starts with headerType then
                   set
theHeader to contents of aHeader
                   exit repeat
               end if
           end repeat
           set
oldDelims to AppleScript's text item delimiters
           set AppleScript's text item delimiters to {"/"}
            set
versionDigit to first character of (text item 2 of theHeader)
            set AppleScript's text item delimiters to
oldDelims
           set temp to category of theMess
       end if
       if
versionDigit is "9" then
           if {category "E2001"} is not in
temp then set temp to {category "E2001"} & temp
       else if versionDigit is "0" then
           if {category "Unknown Client"} is not in
temp then set temp to {category "Unknown Client"} & temp
       else
           if {category "EvX"} is not in
temp then set temp to {category "EvX"} & temp
       end if
       set category of
theMess to temp
   end repeat
end
tell



--
Microsoft MVP for Entourage/OE/Word (Only a volunteer)
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
Applescripts for Outlook Express and Entourage: <http://homepage.mac.com/allenwatson/>

Reply via email to