Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
New Document with Selection for CotEditor
(*
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