Skip to content

Instantly share code, notes, and snippets.

@tzarskyz
Forked from gruber/gist:647224
Created December 5, 2013 15:05
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 tzarskyz/7806853 to your computer and use it in GitHub Desktop.
Save tzarskyz/7806853 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