Hi Chris,
Thank you for contacting Zemax support!
Usually there are two ways to save a text file using ZPL macro. One is through the keyword GETTEXTFILE. The keyword uses following syntax and allows you to create a new text file that saves the information from the Text tab from any OpticStudio analysis window that supports text.
Syntax:
GETTEXTFILE textfilename, type, settingsfilename, flag
The second way is to use keyword OUTPUT. The OUTPUT keyword specifies a destination for text output generated by subsequent PRINT command. Output is either to the screen, or to a file. If OUTPUT SCREEN is specified alone, then all subsequently executed PRINT commands will be directed to the screen. If a valid filename is provided, then subsequent PRINT commands will output to the filename specified. If a filename with no path is provided, output will be directed to the \Macros folder. The syntax is shown below.
Syntax:
OUTPUT SCREEN
OUTPUT filename
If you would like to know more on how to use the keyword, you can find it explained in the Help File at The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > OUTPUT
Let us know if these methods work for you or if you have any other questions.
Best regards,
Hui