Enrico Franchi Homepage

Questo sito è obsoleto. La nuova versione di questa pagina è disponibile presso akropolix

This site is old. The new version of this page is available on akropolix

View source with BBEdit

Quite a long name, isn't it? Anyway... lot's of browsers do colour and indent HTML code, in HTML code viewers. For example OmniWeb and Firefox do it.
Safari doesn't.
Still I can use BBEdit (or free TextWrangler) or another editor with HTML Syntax Highlight capabilities to have the text highlighted.
This is what this applescript does. I will soon or later have BBEdit save the document somewhere in temp so that it is possible to close it without having BBEdit asking whether I do want to save it.
tell application "Safari"
	set cur to document 1
	set mySource to source of cur
	set myName to name of cur
end tell
tell application "BBEdit"
	make new text document with properties ¬
	   {contents:mySource, name:myName}
	activate
end tell

back

xhtml 1.1 CSS 2.1 RSS 2.0
Made with a Mac Made with BBEdit Made with Brain

All documentation is under FDL and all source code is under BSD, unless differently stated.

24-mar-06