Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Toggle HTML parsing in Mail with a simple AppleScript Apps
Since this hint was posted ("Add an HTML filter to catch more spam in Mail.app"), I turned off the download HTML images option in my Mail.app preferences.

But sometimes, I get HTML formatted mail from trusted sources that I want to see. I was getting tired of the round trip to the prefs to turn it on, let it download for viewing, and turning it back off. So I checked the AppleScript dictionary for Mail.app. The solution was incredibly simple. I created the following script and put it in my Scripts menu (which i had activated a long time ago):
  tell application "Mail"
    set download html attachments to true
    delay 2
    set download html attachments to false	
  end tell
It switches the pref, waits two seconds, and switches it back. Two seconds is long enough for it to download the HTML parts (or at least start) for the email you are currently viewing. Mail doesn't store the HTML parts, so if you switch messages and come back, you will be back to the blocked version.

I then remembered that I had downloaded and installed YoupiKey, so I pasted the script into a new shortcut, set it to cmd-shift-H, and am now very happy.
    •    
  • Currently 2.50 / 5
  You rated: 5 / 5 (4 votes cast)
 
[12,439 views]  

Toggle HTML parsing in Mail with a simple AppleScript | 5 comments | Create New Account
Click here to return to the 'Toggle HTML parsing in Mail with a simple AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle HTML parsing in Mail with a simple AppleScript
Authored by: GORDYmac on Feb 21, '03 12:26:39PM

Thanks. I, too, disabled this option after reading Apple's document regarding spammers using HTML image tags to validate email addresses. I'd have to go into the prefs in order to read eNews and other stuff.



[ Reply to This | # ]
Toggle HTML parsing in Mail with a simple AppleScript
Authored by: nvdingo on Feb 21, '03 01:18:14PM

Okay, i since changed my hot key to shift-ctrl-h because cmd-shift-h is 'show all headers'



[ Reply to This | # ]
Toggle HTML parsing in Mail with a simple AppleScript
Authored by: Deut3221 on Feb 22, '03 12:58:18PM

Excellent hint. Thank you!!!
-s

---
<><



[ Reply to This | # ]
Toggle HTML parsing in Mail with a simple AppleScript
Authored by: Azark on Feb 22, '03 01:22:45PM

Excellent! Thanks a lot.

---
PB Ghz 1024 Combo
G4 400 AGP



[ Reply to This | # ]
I can't get this to work!!!
Authored by: tcurtin on Apr 23, '03 03:49:09PM

I don't suppose anyone can help out - this is a great hint, but I get an error in script editor "A identifier can't go after this identifier" with a cancel button, and "applescript english" in light grey in the lower-left of the dialog. It highlights the words "download html" in the line "set download html attachments to true" as it gets this error.

Am I doing something obvious wrong here? I typed the script into script editor directly from this hint:

tell application "Mail"
set download html attachments to true
delay 4
set download html attachments to false
end tell



[ Reply to This | # ]