Ole Morten Halvorsen

March 16, 2008
View Source in TextMate

For reasons unknown to me Safari does not let you choose what application you would like to view the HTML source in. As a web developer I find this frustrating. There are some plugins out there—like SafariStand—that adds syntax highlighting. However it doesn’t let me view the source in TextMate, my editor of choice.

View Source in TextMateIMG

The best solution I’ve found so far is an applescript that saves the source to a file and opens that file in TextMate. I don’t remember where I found this script, but I did not write it, nor trying to take any credit for it.

View HTTP Headers in Safari

Since Safari doesn’t let you view HTTP headers either—I modified the applescript to grab both headers and source and open it in TextMate.

View Source in TextMate with HeadersIMG

For quick access put the applescript somewhere you can launch it with Quicksilver, Launchbar, or similar…


View Source In TextMate (16KB) — 16 Mar 2008

View Source in TextMate with Headers (12KB) — 16 Mar 2008

Update: With the release of Safari 3.1 you can now use the Web Inspector to see HTTP headers. Cool.


#1 Lh

Posted: March 22, 2008

Safari? That translates to WebKit.

Then, iCab can help you. It allows you choose - per page basis, whether to open the source in your editor or inside the browser itself: Select an editor in its preferences. Add the source button the toolbar. Then just Shift-Click that button to open it in in TextMate.

That’s the way I do it. With TextMate.

And it has a Console where you can read the HTTP headers as well.

#2 Ole Morten

Posted: March 22, 2008

Thanks for the iCab tip Lh. The view source in external editor is very nice. I did not get the Console to output any HTTP headers though….

#3 Peter

Posted: April 3, 2008

It’s not the console that outputs headers, it’s the network inspector. Just click on one of the coloured bubbles (timelines) and the headers will drop down.

Leave a comment

Commenting has been disabled. This entry was posted more than 2 weeks ago.

Created by Ole Morten Halvorsen.   Powered by Django.