save command
Use the save command to save the current document.
Syntax
save [ prompt | visible | trim | noTrim | textLimit n | encoding charEncoding | lineSeparator { CRLF | CR | LF } ] [...] [ "filename" ]
Parameters
prompt Use the optional prompt parameter to prompt the user for the name of the file under which this document should be saved. visible Use the optional visible parameter to indicate that only the visible elements should be saved. trim Use the optional trim parameter to indicate that all of the document's lines should be trimmed of any trailing spaces. If you do not specify trim or noTrim, the option is taken from the current setting of the current.save.trim parameter. noTrim Use the optional noTrim parameter to ensure that the document's lines are not trimmed. If you do not specify trim or noTrim, the option is taken from the setting of the current.save.trim parameter. textLimit n Use the optional textLimit parameter to indicate the maximum line length. n must be an integer that is greater than or equal to zero. If n is zero, no maximum line length is enforced. If there are lines in the document that are longer than n, those lines are truncated. If you do not specify textLimit, the setting is taken from the current.save.textLimit parameter. encoding charEncoding Use the optional encoding parameter to specify the character encoding of the saved file. If you do not specify encoding, the character encoding used to load the original file is used. lineSeparator Use the optional lineSeparator parameter to specify the line delimiter characters that should be used for the save. You can specify one of:
- CRLF - "\r\n" (0x0D, 0x0A)
- LF - "\n" (0x0A)
- CR - "\r" (0x0D).
If you do not specify lineSeparator, the default line separator for the platform is used.
filename Use the filename parameter to specify the file name under which this document should be saved. If you do not specify it, the document is saved under the name in the name setting.
Status
The status parameter is set to one of the following:
null Indicates that the save was successful. save.failed Indicates that the save was unsuccessful. save.cancelled Indicates that the save was cancelled by the user.
Description
When saving under a different file name, the trim and textLimit settings are not used.
Note: The implementation of the save operations in an editor application may differ from the behavior of the base editor as described in here.
Examples
save save "test.java"
Editor commands, actions, and parameters
length parameter
name parameter
save.lineSeparator parameter
save.textLimit parameter
save.trim parameter
visible parameter
save action
saveAs action
saveToWriter action
Default editor commands