Skip to content

Instantly share code, notes, and snippets.

@rwilcox
Created August 14, 2012 13:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rwilcox/3349416 to your computer and use it in GitHub Desktop.
Save rwilcox/3349416 to your computer and use it in GitHub Desktop.
Run the current selection as a BBEdit clipping
tell application "BBEdit"
set theScript to selection as text
set clippingFileRef to (path to temporary items as string) & "clipping_as_selection"
--close access clippingFileRef
set fileref to open for access file clippingFileRef with write permission
set eof of fileref to 0 -- clear the file
write theScript to fileref
close access fileref
insert clipping clippingFileRef into window 1
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment