While you work in Listener, you can use the Listener logging feature to capture your entered text and all printed output into
a text file.
Only text entered in either pane and printed output to the output pane is captured.
Macro Recorder output is not captured.
You turn on logging with the
openLog <filename_string> [ mode: "w" | "a" ] [ outputOnly:<boolean> ]
is a string literal or an expression that evaluates to a string, and specifies the name of the log file to be created.
The default mode (
) creates a new file or overwrites an existing file.
To append the log results to an existing file; specify
If the specified file does not exist, an error message will be generated.
Both input and output are logged by default; specify
to log only MAXScript output.
openLog "my_log.txt" mode:"a" outputOnly:true
would append only the MAXScript output to file
If a log file is already open, the
method will close that log file.
MAXScript echoes Listener activity as it occurs to the log file until you stop logging.
The log file data is not continuously written to the file, rather the log data is written to a buffer in memory, and when
the buffer is full the data in the buffer is written to the file.
You can use the
method to ensure the log's buffer is flushed so that all output is written to the file:
You can stop logging, flush the log’s buffer, and close the log file using the
No error message is generated if the
methods are called and no log file is open.