// This macro measures all the images in a folder. // It uses the IJ.redirectErrorMessages() function // to prevent itself from being aborted if there is // an error opening an image. dir = getDirectory("Choose a Directory "); list = getFileList(dir); run("Close All"); setOption("display labels", true); setBatchMode(true); for (i=0; i0) run("Measure"); else { n = nResults(); setResult("Label", n, list[i]); setResult("Mean", n, NaN); updateResults; } run("Close All"); }