Login  Register

getDirectory command does not show files

Posted by patrick coffey on Jan 18, 2015; 7:52pm
URL: http://imagej.273.s1.nabble.com/getDirectory-command-does-not-show-files-tp5011272.html

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