I'm surprised Xdialog doesn't have a specific direct filename mode.
I installed it to try it out, and (for me, anyway) it dragged in gtk 1.2
libraries, so I poked around for a gtk 2.0 equivalent and found zenity,
which has handy "--file-selection --save" options.