Login  Register

Re: Let the user choose a file ?

Posted by Wayne Rasband on Aug 20, 2007; 10:25pm
URL: http://imagej.273.s1.nabble.com/Let-the-user-choose-a-file-tp3698562p3698563.html

The File.openDialog() method, in ImageJ 1.39d and later, does this.
Here is an example:

     path = File.openDialog("Choose a File");
     print("path:", path);
     print("name:", File.getName(path));
     print("directory:", File.getParent(path));

-wayne

On Aug 20, 2007, at 11:19 AM, Christophe Leterrier wrote:

> Is there a macro function that prompt the user to choose a file and
> returns its path ?
>
> The open() command can prompt the file chooser, but will open it, and
> I don't want to open the file, just to get its path from the file
> chooser dialog.
>
> Christophe Leterrier
>