Login  Register

Re: getDirectory command does not show files

Posted by Peterbauer Thomas on Jan 19, 2015; 6:09am
URL: http://imagej.273.s1.nabble.com/getDirectory-command-does-not-show-files-tp5011272p5011274.html

It's not a bug, it's a feature. With 'getDirectory(string)', the user is
asked to choose a directory, so there's no sense in displaying normal
files. If you want a normal file chooser displaying everything (files
and folders), use 'File.openDialog(title)'.

On 2015-01-18 20:52, Patrick Coffey wrote:

> I'm using the getDirectory("") command and the dialog window shows up but only folders, not files appear in the window. For instance, the example below won't show the files (only folders) in the dialog window. This is happening on two different versions of imageJ and two different computers. Not sure what the problems is ... settings? Help appreciated!!
>
> macro "Batch Measure" {
>      dir = getDirectory("Choose a Directory ");
>      list = getFileList(dir);
>      if (getVersion>="1.40e")
>          setOption("display labels", true);
>      setBatchMode(true);
>      for (i=0; i<list.length; i++) {
>          path = dir+list[i];
>          showProgress(i, list.length);
>          if (!endsWith(path,"/")) open(path);
>          if (nImages>=1) {
>              run("Measure");
>              close();
>          }
>      }
> }
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html