Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@1024jp
Created February 29, 2012 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1024jp/1936536 to your computer and use it in GitHub Desktop.
Save 1024jp/1936536 to your computer and use it in GitHub Desktop.
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