title: SaveAs in a loop with ImageJ
body: <p>I'm brand new to imageJ and its macros, I can't save a Results file from Particle Analyze in a loop.</p>
  
  <p>Here is my code, made of what I just learned on internet and I just can't include <code>[i]</code> in the <code>saveAs</code> function and there is a mismatch with the saving of the images while I have not even try yet to save it...</p>
  
  <pre class="lang-bs prettyprint-override"><code>path1=getDirectory("Mydir");
  list=getFileList(path1);
  path2=getDirectory("My output dir");
  setBatchMode(true);
  
  for(i=0;i&lt;list.length;i++){
      open(path1+list[i]);
      run("8-bit");
      run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=[Bare Outlines] display clear");
      selectWindow("Results");
      saveAs("Results", path2+"Results.xls");
      close();
  } 
  setBatchMode(false);
  run("Close");
  </code></pre>