-
-
Save gruber/647224 to your computer and use it in GitHub Desktop.
Slight tweaks to dpkendal's script. Gives the BBEdit document a name (rather than "untitled <integer>", and skips the \n to \r stuff, which I don't think is necessary in recent versions of BBEdit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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