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.
That's really odd - I thought (based on what it looks like) that 'Xdialog' was one of the old guard; the Athena Toolkit or something like that. Bleh. :(
On the other hand, modifying it to use none of those libraries, at least for the dialog end, is trivial: change 'Xdialog' to 'dialog', remove the 'xterm -e' line from the 'vi' invocation, and launch the whole script as 'xterm -e pmedit'.
--
Human history becomes more and more a race between education and catastrophe. -- HG Wells