Use the menu entry Services / Copy to file of the View program to copy source code into a file; use the menu entry Services / Append to File of the View program to append source code to that file.