Skip to content

Instantly share code, notes, and snippets.

@tofias
Created February 12, 2013 22:04
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 tofias/4773865 to your computer and use it in GitHub Desktop.
Save tofias/4773865 to your computer and use it in GitHub Desktop.
Makes a new file in BBEdit using contents of clipboard.
-- Make a BBEdit
-- Michael Tofias 2013-02-12
-- https://gist.github.com/tofias/4773865
set toPaste to the clipboard as Unicode text
tell application "BBEdit"
activate
make new document
if toPaste is not "" then
try
set properties of text window 1 to {contents:toPaste}
on error
display dialog "Something went wrong with your pasting."
end try
else
display dialog "Sorry, but there was nothing to paste."
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment