This page explains how to pass your document's text to UNIX scripts that are executable via the Script menu, or how to receive the outputs from them.
To pass text data from CotEditor to your script, you need to put a comment at the beginning of the script and write “%%%{CotEditorXInput=xxxx}%%%
” inside. Replace “xxxx
” with one of the parameters below.
Selection | To pass the text you are currently selecting. |
---|---|
AllText | To pass the whole text of your document. |
None | To pass nothing (default). |
To make CotEditor receive output data from a script, you need to put a comment at the beginning of the script and write “%%%{CotEditorXOutput=xxxx}%%%
” inside. Replace “xxxx
” with one of the parameters below.
ReplaceSelection | To replace the current selection with the contents of the output data. |
---|---|
ReplaceAllText | To replace the whole text of your document with the contents of the output data. |
InsertAfterSelection | To insert the contents of the output data right after the current selection. |
AppendToAllText | To insert the contents of the output data at the end of your document. |
Pasteboardputs | To store the contents of the output data in clipboard. |
Discard | To do nothing (default). |