Forked from rwilcox/run_selection_as_clipping.applescript
Created
April 14, 2022 07:16
-
-
Save extratone/9b695ff0949a23eaafbd0f7996b7aab0 to your computer and use it in GitHub Desktop.
Run the current selection as a BBEdit clipping
This file contains hidden or 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 "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