--- a/tcl/pd_menucommands.tcl
+++ b/tcl/pd_menucommands.tcl
@@ -127,12 +127,7 @@
         } elseif {$message eq "selectall"} {
             .pdwindow.text tag add sel 1.0 end
         } elseif {$message eq "menusaveas"} {
-            set contents [.pdwindow.text get -displaychars -- 1.0 end]
-            set filename [tk_getSaveFile -initialfile "pdwindow.txt" -defaultextension .txt]
-            if {$filename eq ""} return; # they clicked cancel
-            set f [open $filename w]
-            puts $f $contents
-            close $f
+            ::pdwindow::save_logbuffer_to_file
         }
     }
 }