Skip to content

Instantly share code, notes, and snippets.

@bosmacs
Forked from gruber/gist:647224
Created December 3, 2010 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bosmacs/727199 to your computer and use it in GitHub Desktop.
Save bosmacs/727199 to your computer and use it in GitHub Desktop.
tell application "Safari"
set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1
set _name to name of document 1
end tell
tell application "BBEdit"
make new text window with properties ¬
{contents:_source, source language:"HTML", name:"Generated source: " & _name}
select insertion point before character 1 of text window 1
tell window 1
activate
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment