Toggle viewing images in Mail.app via Applescript

Oct 23, '03 10:40:00AM

Contributed by: Greedo

Usually I leave HTML/images disabled in Mail.app. But sometimes I'd like the ability to enable them for one particular email, then disable it again. It was a bit of a pain to dig through the preferences each time this happened.

Applescript to the rescue!


tell application "Mail"
  set currentState to download html attachments
  if currentState = false then
    set newState to true
  else
    set newState to false
  end if
    
  set download html attachments to newState
  display dialog ¬
   "Download HTML attachments set to \"" & ¬
   newState & "\"." buttons {"OK"}
 
end tell
Pretty simple, but useful!

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031022153919228