cot commandCotEditor has 'cot' command-line tool which allows you to control CotEditor from the command-line. To use cot command, install it at first.
You can install the cot command-line tool to a desired location creating a symbolic link via Terminal. The cot substance is bundled at 'Contents/SharedSupport/bin/cot' in CotEditor.app (We recommend to create it at '/usr/local/bin/').
ln -s /Applications/CotEditor.app/Contents/SharedSupport/bin/cot /usr/local/bin/cot
And uninstallation via Terminal is like the following:
unlink /usr/local/bin/cot
The following options can be used on cot command.
-w, --wait | Wait for opened file to be closed before returning to a prompt. |
|---|---|
-n, --new | Create a new blank document. |
-l, --line <line> | Jump to specific line in opened document. <line> is an integer specifying the number of line. |
-c, --column <column> | Jump to specific column in opened document. <column> is an integer specifying the number of column. |
-b, --background | Do not bring the application to the foreground. |
-h, --help | Show help. |
-v, --version | Print version information. |
A simple cot command will launch CotEditor, or just activate it if CotEditor is already running.
cot
The following command opens the foo.txt file on CotEditor and scroll to the line 200 in the opened document. cot command do nothing if foo.txt file is not exists.
cot --line 200 foo.txt
You can also pipe a text. CotEditor will open a new document with the piped text.
echo "I am a dog but also a cow at the same time." | cot