New Document with Selection for CotEditor
This file contains 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
(* | |
New Document with Selection | |
by 1024jp 2012-02-29 | |
[description] | |
open selection in new document on CotEditor | |
*) | |
-- __main_______________________________________________________________ | |
tell application "CotEditor" | |
if exists front document then | |
set {loc, len} to range of selection | |
if len > 0 then | |
set curStr to contents of selection of front document | |
make new document | |
set contents of front document to curStr | |
end if | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment