/savebuf [-sgao] [lines] <window | dialog id> <filename>
Saves the specified number of lines from the end of the buffer of the specified window into the specified filename.
/savebuf 20 @test info.txt
This saves the last 20 lines in custom window @test to info.txt.
/savebuf 10-40 @test info.txt
This saves lines 10 to 40 in custom window @test to info.txt.
The -s switch saves the status window buffer, the -g switch saves the finger window buffer, and the -a switch makes it append the text to the end of a file instead of overwriting it.
The -o switch indicates that you have specified [dialog id] parameters instead of a window name in order to save text from a custom dialog control.
//savebuf 10 $active yourfilenamehere