title: There are no images open - Fiji/ImageJ macro language
body: <p>I wrote a macro in Fiji to perform a set of operations on all the images in a particular folder. But I ran into trouble and can't get over one problem. I get an error message that says 'There are no images open' when I run the macro. What does it mean? (The images in input folder are of .tif type)</p>
  
  <p>Here's the macro:</p>
  
  <pre class="lang-js prettyprint-override"><code>input =  "C:"+File.separator+"Winter Quarter slides"+File.separator+"CTIA"+File.separator+"Project"+File.separator+"Original Image data"+File.separator+"Input Images"+File.separator;
  
  output =  "C:"+File.separator+"Winter Quarter slides"+File.separator+"CTIA"+File.separator+"Project"+File.separator+"Original Image data"+File.separator+"Output Images"+File.separator;
  
  setBatchMode(true);
  list=getFileList(input);
  for(i=0; i&lt;list.length; i++)
      action(input,output,list[i]);
  setBatchMode(false);
  
  function action(input,output,filename) {
      open(input+filename);
      run("16-bit");
      run("Gaussian Blur...", "sigma=3");
      setAutoThreshold("Otsu");
      //run("Threshold...");
      setAutoThreshold("Otsu");
      setOption("BlackBackground", false);
      run("Convert to Mask");
      run("Close");
      run("Watershed");
      saveAs("Tiff", output+filename);
      close();
  }
  
  close();
  </code></pre>
  
  <p>Can someone please help me out with it asap? 
  Thanks!</p>