Re: FileNameDialog
- To: mathgroup at smc.vnet.net
- Subject: [mg38890] Re: FileNameDialog
- From: moseley at stars.gsfc.nasa.gov (Harvey M.)
- Date: Fri, 17 Jan 2003 05:39:15 -0500 (EST)
- References: <avrjsb$995$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"P.J. Hinton" <paulh at wolfram.com> wrote in message news:<avrjsb$995$1 at smc.vnet.net>... > On Fri, 10 Jan 2003, Rainer Bausch wrote: > > > In a contribution to mathgroup, somebody asserted in 1997 that > > > > userFile=FrontEndExecute[{FrontEndToken["FileNameDialog"]}] > > > > allows the user to input a file name from the Windows file selector box > > into a Mathematica variable. (Search in the Archive for the keyword > > FileNameDialog; to find this contribution.) However, this does not work > > in Mathematica 4.1 (under Windows NT). I guess that it did not work in > > 3.0 either. > > > > It is true that the file selector box appears, and that the name and path > > of the selected file is pasted into the notebook, but the user filename > > entry is not transferred into the variable. > > If the goal is to store the result of the file browse operation as a > kernel string, then the code you need to use is: > > userFile = Experimental`FileBrowse[] > > The code you cite is the programmatic equivalent of the front end menu > command Input -> Get File Path... I am using Mathematica 4.2 on Mac OS X (Ver 10.2.3). I have tried the userFile = Experimental`FileBrowse[] as P. Hinton recommends, and I get a "file save" dialog; all the file names are greyed out, and the dialog is asking me for a file name to save. I can't figure out how to get it to return the file name. Thanks, Harvey