Title: Re: Would like a printed list of messages in a Folder
On 1/5/02 2:42 am, "Jim Colgate"  wrote:

>
> Does anyone know of a capability or script to generate such a list for
> identifying the messages in a folder?
>
> Thanks
>
>  Jim
>

This is the second time in recent days that I have seen this request, so here's a script to summarise what you want.

It will create a tab-delimited text summary of the selected message, and put this data on the clipboard, ready to be pasted into word, excel or whatever you find appropriate.

It's been done quickly, so there's not been a lot of testing, but it seems to cope with multiple attachments, long recipient lists, recipients without full addresses etc. If you find it trips up on anything, let me know and I'll tweak it. I have only tried the script with Entourage vX, but I can see no reason why it wouldn't work in v2001 as well.

Post the script below into script editor and save it as a compiled script in the 'Entourage Script Menu Items' folder that you will find in your MUD folder.

(note, this message has been posted as HTML to avoid line wrapping in the script. If you can’t get the script to compile, mail me off-list and I’ll send you a precompiled version)

I will (in a day or two) send the script off to AppleScriptcentral.com, but I’ve submitted a few there in recent weeks and they haven’t been posted yet (are you there Eric?) so I don’t know how long it will take to get them up there.


-- Start of Script --
tell application "Microsoft Entourage"
    try
        set theMessages to current messages
    on error
        beep
        return -99
    end try
    set oldTIDs to AppleScript's text item delimiters
    set summaryList to {"From" & tab & "Date/Time" & tab & "Subject" & tab & "Recipients" & tab & "Attachments"}
    repeat with aMessage in theMessages
        tell aMessage
            set theSender to "\"" & display name of sender & "\" <" & address of sender & ">"
            set timeSent to time sent as string
            set theSub to subject
            if attachments is not {} then
                set AppleScript's text item delimiters to {", "}
                set theAttachments to (name of every attachment) as string
            else
                set theAttachments to ""
            end if
            set theRecips to every recipient
            set recipList to {}
            if length of theRecips > 3 then
                set extraRecips to (count theRecips) - 3
                repeat with x from 1 to 3
                    copy "\"" & display name of address of item x of theRecips & "\" <" & address of address of item x of theRecips & ">" to end of recipList
                end repeat
                set theRecips to recipList
                copy "+ " & extraRecips & " additional recipients" to end of theRecips
            else
                repeat with x from 1 to length of theRecips
                    copy "\"" & display name of address of item x of theRecips & "\" <" & address of address of item x of theRecips & ">" to end of recipList
                end repeat
                set theRecips to recipList
            end if
            set AppleScript's text item delimiters to {", "}
            set theRecips to theRecips as string
            set AppleScript's text item delimiters to {tab}
            copy {theSender, timeSent, theSub, theRecips, theAttachments} as string to end of summaryList
        end tell
    end repeat
end tell
set AppleScript's text item delimiters to return
set the clipboard to summaryList as string
set AppleScript's text item delimiters to oldTIDs
-- End of Script --
--
Barry Wainwright
<http://www.barryw.net>


Age is a very high price to pay for maturity.

Reply via email to