title: Why is my for loop not increasing increments?
body: <p>I am writing a macro in imagej to do batch analysis of photos in a folder. When I run the macro it seems that the code is only running once and not moving onto the next file. I believe it is an issue in my code block not the actual for statement. If anyone could point out what might be causing this I would be greatly appreciated. The code is copied below. The for loop starts in line 23 and the function it runs is line 32.</p>
  
  <pre><code>Dialog.create("Our Batch Analysis");    //providing choises about analysis 
  Dialog.addNumber("Min Size", 1000);
  Dialog.addNumber("Max Size", 9999999);
  Dialog.addCheckbox("View Obect Outlines", false);
  
  smoothArray=newArray("Mean...", "Median...", "None");
  Dialog.addChoice("Smooth Filter", smoothArray, "Mean");
  
  Dialog.show();
  
  our_min=Dialog.getNumber();     //assigning the collected values to variables to be used in analyzeImage
  our_max=Dialog.getNumber();
  our_outlines=Dialog.getCheckbox();
  our_smooth=Dialog.getChoice();
  
  our_dir=getDirectory("Choose Source Directory");    //Choosing the folder to analyze 
  our_list=getFileList(our_dir);
  
  
  for(i=0; i&lt;our_list.length; i++)    //cycling through images in folder
  {
  if(endsWith(our_list[i],".jpg"))        //only analyzing images no text files
  {
  open(our_dir + our_list[i]);
  analyseImage();
  }
  }
  
  analyseImage();     //declaring function 
  function analyseImage()
  {
  origTitle= getTitle () ;    //creating a callable title 
  run("Duplicate...", "title=duplicate");  //making a duplicate file to work with without affecting original
  run("Gaussian Blur...", "sigma=2");
  if(our_smooth!="None")      //making smoothing conditional
  {run(our_smooth, "radius=2");
  setAutoThreshold("Default");        //setting a threshold to differentiate background
  setThreshold(0, 127); 
  setOption("BlackBackground", true);
  run("Convert to Mask");     //turning the image binary
  run("Watershed");
  run("Set Measurements...", "area mean shate display redirect=[" + origTitle + "] decimal =2");
  
  if(our_outlines==true)
  {
  run("Analyze Particles...", "size=" +our_min+"-"+our_max+" circularity =0.80-1.00 show=Outlines display exclude");  
  rename(origTitle+"-outlines");
  selectWindow(origTitle+"-outlines");
  close();
  }
  else
  {
  run("Analyze Particles...", "size=" +our_min+"-"+our_max+" circularity =0.80-1.00 show=Nothing display exclude");   //counting how many particles exist based on given parameters
  }
  
  selectImage(origTitle); //closing unwanted tabs
  close();    
  selectImage("duplicate");
  close();
  }
  </code></pre>