Posted by
patrick coffey on
Jan 19, 2015; 6:30am
URL: http://imagej.273.s1.nabble.com/getDirectory-command-does-not-show-files-tp5011272p5011275.html
Thanks for your answer. Ultimately I was trying to get a "list" of files in the directory that is selected by the user.
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Thomas Peterbauer
Sent: Sunday, January 18, 2015 10:09 PM
To:
[hidden email]
Subject: Re: getDirectory command does not show files
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--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html