Title: Re: getting rid of those silly email backgrounds
On or near 2/6/04 9:19 AM, Kirk McElhearn at [EMAIL PROTECTED] observed:

> On 2/6/04 6:14 PM, "tuqqer" <[EMAIL PROTECTED]> wrote:
>
>> Any thoughts? Am I the only one bugged by these things?
>
> Yes. In fact, since I have HTML display turned off, I don't understand why
> the backgrounds get displayed.
>
They are not images read with HTML tags; they are attached files. Those always get displayed, I believe. I'll attach a photo to see if that works. Oh...wait, no attachments to the list! (Hm, there you go; just do all your correspondence via a mailing list! ;-)) I'll send a copy to the list with no attachments, and another copy to Kirk and tuqqer with

It would be possible, I think, to set up a rule that would run a script to delete attachments that are below a certain size and are .jpg or .gif. The rule could specify:

    if any criteria are matched;
    if <attachment name ends with> .jpg
    if <attachment name ends with> .gif

    ACTION: Run Applescript: path-to-script

The script could be as simple as the attached file. It will delete any attachment that is less than 10K. The rule above makes sure it runs only against JPEG and GIF files. To be safe I have the script save the attachment in ~/Documents/ProbablyJunk/:

tell application "Finder"
    set ProbablyJunkFolder to ((path to documents folder) as string) & "ProbablyJunk:"
    try
        get alias ProbablyJunkFolder
    on error
        make new folder at (path to documents folder as string) with properties {name:"ProbablyJunk"}
    end try
end tell
tell application "Microsoft Entourage"
    set theMsg to item 1 of (get current messages)
    set theAttachments to attachments of theMsg
    repeat with i from 1 to (count theAttachments)
        set anAttachment to item i of theAttachments
        set theSize to data size of the content of anAttachment
        set sizeInK to (1 + theSize div 1024)
        if sizeInK < 10 then save anAttachment in ProbablyJunkFolder
        if sizeInK < 10 then delete anAttachment
    end repeat
end tell
    
        
>


--
Microsoft MVP for Entourage/OE/Word (MVPs are volunteers)
Allen Watson <[EMAIL PROTECTED]> Entourage FAQ site: <http://www.entourage.mvps.org/>
AppleScripts for Outlook Express and Entourage:
 <http://members.thinkaccess.net/[EMAIL PROTECTED]/Scripts/>
Entourage Help Pages: <http://www.entourage.mvps.org/>

Reply via email to