Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save extratone/9b695ff0949a23eaafbd0f7996b7aab0 to your computer and use it in GitHub Desktop.

Select an option

Save extratone/9b695ff0949a23eaafbd0f7996b7aab0 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