In CotEditor, you can make a document read-only so it can’t be edited, or lock it so it can’t be edited or deleted.
If a document is read-only or locked, you can edit it again after removing the read-only state or unlocking it.
CotEditor can temporarily prevent a document from being edited to avoid unintended data modifications while reading. This state is only valid while the document is open in CotEditor and is not saved to the file.
To prevent a document from being edited, do one of the following:
In the CotEditor app
on your Mac, choose Format > Prevent Editing.
From an AppleScript script, set the editable property of the document object to false.
To open a document as read-only, do one of the following:
In the CotEditor app
on your Mac, choose File > Open, select the “Open as read-only” checkbox in the Open dialog, then click Open.
From the cot command-line tool, open documents with the --readonly (-r) option.
To allow editing a document being prevented from editing in the CotEditor app
on your Mac, choose Format > Allow Editing.
You can also customize the toolbar and add the Edit toolbar item to quickly switch between preventing and allowing editing.
When a document is prevented from being edited, a read-only icon appears on the status bar.
Locking is a macOS feature that protects documents from being accidentally changed or deleted. This state is saved in the file and persists when you work with the document in other apps on your Mac.
To lock a document in the CotEditor app
on your Mac, place the pointer to the right of the document title at the top of the document window, click the arrow that appears, then select Locked.
To unlock a document in the CotEditor app
on your Mac, deselect Locked.
Tip: You can also lock or unlock a document from the Finder. For details about the Lock feature on Mac, see Lock a document on Mac.