A script to toggle Safari's appearance settings

Feb 11, '04 10:00:00AM

Contributed by: roncross@cox.net

I load a lot of pages with Safari and it can take a long time to load pages from time to time. I wrote an AppleScript that toggles appearance so that pages load faster. When I read a page that I am really interested in reading, I can then toggle appearance again and reload page.

The script is as follows:


tell application "Safari"
  activate
  tell application "System Events"
    tell application process "Safari"
      key down command
      keystroke ","
      delay 1
      key up command
    end tell (*  end application process Safari  *)
  end tell (*  end System Events   *)
  tell application "System Events"
    click button "Appearance" of tool bar 1 of window 1 of ¬
     application process "Safari"
    delay 1
    click checkbox "Display images when the page opens" of ¬
     group 1 of group of window "Appearance" of application process "Safari"
    delay 1
    click menu item "Close Window" of menu "File" of ¬
     menu bar 1 of application process "Safari"
  end tell
end tell (*  end Safari  *)
That's it. Load 'um Safari!

[robg adds: Save this script in your user's Library -> Scripts folder for easy access from the Scripts menu.]

Comments (8)


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