Here's what I have. Just list all the attachments you don't want in the
badAttachment property

New filter:

Conditions:
  Filter always

Actions:
  Execute AppleScript 'Remove Listed Attachments'

<applescript title="Remove Listed Attachments">
property badAttachment : {"winmail.dat", ".exe", ".vcf"}

tell application "PowerMail"
        set theMessages to current messages
        repeat with msg in theMessages
                 if exists (attachments of msg) then
                  my stripAttachment(badAttachment, msg)
   end if
        end repeat
end tell

on stripAttachment(propList, msg)
        tell application "PowerMail"
                repeat with attach in every attachment of msg
                        repeat with i from 1 to the number of items of propList
                                ignoring case
                                        if (name of attach contains item i of 
propList) then
                                                set f to file of attach
                                                tell application "Finder"
                                                        try
                                                                move f to trash
                                                        end try
                                                end tell
                                        end if
                                end ignoring
                        end repeat
                end repeat
        end tell
end stripAttachment
</applescript>


-- 
Andy Fragen

On Thu, Feb 9, 2006, Dave Nathanson said:

>D'oh! 
>It would be really great if the PowerMail team add a mail action to
>operate only on attachments that meet a criteria? That would be really
>excellent! (hopefully before I drown in .vcf files!)
>
>Best,
> Dave Nathanson
> Mac Medix
>
>On Thu, 9 Feb 2006 16:13:19 -0500 (EST), Wayne Brissette
>([EMAIL PROTECTED]) wrote:
>>> So, the problem is now: 
>>> How do I automatically trash only certain attachments when there are 
>>> multiple attachments, leaving the non ".vcf" files unmolested? 
>> 
>> A custom AppleScript has to be written. 
>> 
>> Wayne






Reply via email to