Webgraph: Building Better

(print-stylesheet in effect)

Resources: View Browser Source (AppleScripts)

Download Version 1.3 Now!

Once upon a time, Zeldman expressed a mild dissatisfaction about the lack of support in OS X browsers for viewing web page source code in an external editor. We thought we should do something about it. We did.

About the Scripts

The AppleScripts are available for the following OS X browser flavors:

  • Camino 0.7
  • Chimera 0.6
  • IE 5.2.2
  • Mozilla 1.4
  • Netscape 7
  • Opera 6
  • Safari 1.0

and currently have built-in support for the following external editors (including CLI):

  • BBEdit
  • emacs
  • PageSpinner
  • pico
  • TextEdit
  • vi

Setup and Usage

Very little setup is required before you use these scripts—in fact, if you use TextEdit, you can use the scripts without modifying them at all.

If you prefer BBEdit, PageSpinner, or one of the CLI programs as your editor-of-choice, simply perform the following steps:

  1. Open one of the scripts in Script Editor
  2. Comment out the code for TextEdit, using (* to start and *) to end the comment
  3. Uncomment the code for BBEdit, PageSpinner, emacs, pico or vi by removing the (* and *)
  4. Save the script

To use the script, you can: Save it as a double-clickable application from within Script Editor (open the script, choose Save As... from the File menu, and select Application from the Format pop-up in the Save dialog); Add the script to Apple's Script Menu (view instructions); or you can use DragThing to assign the script to a keyboard command (like Zeldman, we use Command-E for this). The latter method is highly recommended.

Requirements

The scripts don't require much, although they have only been tested with the browser versions listed above, so your mileage may vary with other version numbers (Chimera users: you must use the December 20th release or newer for the AppleScript commands to work). Please contact us if you find a version that doesn't work with the scripts, and we'll try to fix the problem.

These scripts are for OS X only, and have not been tested under OS 9/Classic (nor will they be). All scripts have been tested on Mac OS X 10.2.4 (Jaguar) with no extra Scripting Additions installed.

Download

All seven versions of the script (one tailored for each browser's AppleScript capabilities) are available in one handy SIT file for your downloading pleasure:

View Browser Source AppleScripts (version 1.3)

Updates to these scripts will be posted here, as they are needed. You will probably hear about any such updates via Zeldman or SuperfluousBanter.

Version History

1.3 (08/28/03)

  • [Added] Support for Safari 1.0
  • [Added] Support for Mozilla 1.4

1.2 (04/10/03)

  • [Added] Support for Camino
  • [Added] Cursor is now placed at the beginning of file in BBEdit
  • [Fixed] Safari line feed issues with BBEdit (as per DaringFireball.net)

1.1 (01/27/03)

  • [Added] Support for Command Line editors emacs, pico and vi
  • [Fixed] Error in Netscape and Mozilla scripts (AppleScript error -1700)
  • [Fixed] All scripts except Chimera now retrieve the source from the frontmost browser window (currently Chimera only supports the first opened window)

1.0 (01/22/03)

  • First Public Release

1.0b (01/19/03)

  • Private Beta Release (Zeldman)

Thanks

Special thanks to the following individuals, for inspiration, bug reporting, feature suggestions, and the like:

  • Jeffery Zeldman
  • John Gruber
  • Toby Sterrett
  • Nathan Steiner
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.