Does anybody know if Mail.app is scriptable?

Can I hack up the following to work with Mail.app?

tell application "Microsoft Entourage"
    set theMessList to every message of folder "Sent Items"
    if theMessList is not {} then
        set hitCount to 0
        repeat with aMess in theMessList
            tell aMess
                set attList to {}
                try
                    set attList to name of every attachment
                end try
                if attList is not {} then
                    repeat with x from (count attList) to 1 by -1
                        if item x of attList contains "resume" then
                            delete attachment x
                            set hitCount to hitCount + 1
                        end if
                    end repeat
                end if
            end tell
        end repeat
        say "" & hitCount & " resume attachments deleted"
    else
        display dialog "No Messages in the folder!" buttons {"Stop"} default
button 1 with icon stop
    end if
end tell


-- 
To unsubscribe:                     
<mailto:[EMAIL PROTECTED]>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to