// This is a command line macro that processes
// all the tiff images in a specified directory.
  dir = getArgument();
  if (dir=="")
      dir = getDirectory("Select a Directory");
  if (!(endsWith(dir, "/")||endsWith(dir, "\\")))
      dir = dir + "/";
  list = getFileList(dir);
  run("Set Measurements...", "area mean display redirect=None decimal=3");
  for (i=0; i<list.length; i++) {
     if (endsWith(list[i], ".tif")) {
         run("Open...", "path='"+dir+list[i]+"'");
         run("Measure");
     }
  }


