Reload Commands List Command
Purpose
The Reload Commands List command is used to replace the list
of command titles displayed at the end of the
Tools menu. Normally this list is loaded at the startup
of NOTEFILE if the
NOTEFILE.CMD executable file is present in the
same directory where the NOTEFILE executable is placed. However, if
there is some error during execution of NOTEFILE.CMD, then this loading
process is silently aborted and nothing is displayed at the end of
the Tools menu. Also, as a security precaution, the user can disable the
automatic loading process by setting an environment variable as explained
in the Security subsection below.
If you make changes to the NOTEFILE.CMD file while NOTEFILE is running, you may have to reload the list of command titles, so that the end of the Tools menu is updated with the new list. This is only necessary when the list has changed, but not when the code for a specific command has changed.
In Linux, the file name should be in lowercase.
To reload the list of command titles from NOTEFILE.CMD executable
- From the Tools menu, choose Reload Commands List.
- If there is an executable file called NOTEFILE.CMD in the same directory as the NOTEFILE executable, it will be run without parameters. It is expected that NOTEFILE.CMD runs with no errors and outputs a list of the parameters and the titles of commands it supports. In such a case, the end of the Tools menu will be populated with the list of command titles. Otherwise, it will remain empty and an error message will be displayed.
Note: Only the first 25 command titles from the output that are properly formatted will be loaded; the rest will be ignored.
For more information about the NOTEFILE.CMD file, look at the Command File help topic.
Security
The automatic loading process of the command list
can be a security risk. For this reason,
a special environment variable named
NOTEFILE can be used to disable this. You can set this
environment variable to contain some strings separated by
colon (:) or semicolon (;).
If the string NOCMD is present among them,
then the automatic loading during program startup will
be skipped. However, manual reloading is always possible later as long
as the NOTEFILE.CMD file is present and has no errors.
Error messages
- Executable not found: path
- Failed to execute: path
- The NOTEFILE.CMD file should be in the same directory as the NOTEFILE executable file being run. In Linux, its name should be in lowercase.
- ... STANDARD ERROR FROM COMMAND: ...
- ... EXIT CODE OF COMMAND: ...
- Some
stderr
output and/or non-zero
exit code were produced
during the execution of NOTEFILE.CMD. If the exit code is zero,
then the exit code and
stdin
(i.e., the selected text) are not displayed and the dialog box will be of
information
type.