Image view toggle.

From This script was posted by a user who was frustrated at digging through’s preferences to turm image viewing on/off.

OS version: OS X

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