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:

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

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 Dan 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)

1.2 (04/10/03)

1.1 (01/27/03)

1.0 (01/22/03)

1.0b (01/19/03)

Thanks

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