on run tell application "Microsoft Entourage" -- delete messages that have <threshhold> percentage of characters -- outside the range of A..Z and a..z (and space) in the subject line. -- This is to zap emails that substitute special character for letters, to get -- past spam filters that drive off key words. Threshhold can be -- adjusted as you see fit. I arbitrarily chose .15. Also, the characters -- included or excluded in either category can be easily changed. -- NOTE: This permanently deletes, so if you don't want that, just -- remove the 2nd delete below. set CurrMessages to the current messages set alphaChar to 0 as integer -- number of Alpha characters and Space set otherChar to 0 as integer -- number of non Alpha characters set otherRatio to 0.0 as real -- otherChar / alphaChar set threshhold to 0.15 as real -- adjust this to whatever works repeat with theMsg in the CurrMessages set subj to the subject of theMsg repeat with thisCharacter in the characters of subj set thisCharacter to thisCharacter as text if (thisCharacter ≥ "A" and thisCharacter ≤ "Z") or (thisCharacter ≥ "a" and thisCharacter ≤ "z") or (thisCharacter = " ") then set alphaChar to alphaChar + 1 else set otherChar to otherChar + 1 end if end repeat set otherRatio to otherChar / alphaChar end repeat if otherRatio > threshhold then delete theMsg -- put in Deleted Folder delete theMsg -- delete permanently end if end tell end run
linuxcoder
linuxcoder
Member Since 05 Aug 2012Offline Last Active Aug 10 2012 11:15 PM



Sign In
Create Account

Find content
Not Telling