Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Open source of current Safari document in BBEdit
(*
Open source of current Safari document in BBEdit
David Miller
https://readmeansrun.com
*)
set mycontents to ""
set myname to ""
try
tell application "Safari"
set mytab to current tab of window 1
set mycontents to source of mytab
set myname to URL of mytab
end tell
tell application "BBEdit"
set doc to make new document
set contents of doc to mycontents
set name of doc to myname
activate
end tell
on error
beep
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.