<html>
    <head>
      <base href="http://fiji.sc/bugzilla/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:wsr@nih.gov" title="Wayne Rasband <wsr@nih.gov>"> <span class="fn">Wayne Rasband</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - batch mode not working"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=1171">bug 1171</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEEDSINFO
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - batch mode not working"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=1171#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - batch mode not working"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=1171">bug 1171</a>
              from <span class="vcard"><a class="email" href="mailto:wsr@nih.gov" title="Wayne Rasband <wsr@nih.gov>"> <span class="fn">Wayne Rasband</span></a>
</span></b>
        <pre>Here is a version of your macro that should work better. I marked the changes
with "//**".

dir = getDirectory("Choose Sorce Directory"); //with slash at the end
dir2 = getDirectory("Choose Destination Directory");
acq = getFileList(dir);
setBatchMode(true); 
for (i=0; i<acq.length; i++) {
    if (endsWith(acq[i], "tif")) {
        open(dir+acq[i]);
        run("Make Composite");
        run("Split Channels");
        close("C3-"+acq[i]);
        imageCalculator("Subtract stack", "C2-"+acq[i], "C1-"+acq[i]);
        //Save Z-projection of 169
        selectWindow("C2-"+acq[i]);
        run("Despeckle", "stack");   //**
        run("Z Project...", "projection=[Average Intensity]");
        selectWindow("AVG_C2-"+acq[i]);
        path = dir2+"Zproj-169-BGsubtr-"+acq[i]; //**
        run("Save", "save=&path"); //**
        close("AVG_C2-"+acq[i]);
        //Save Z-projection of SHG
        selectWindow("C4-"+acq[i]);
        run("Despeckle", "stack"); //**
        run("Z Project...", "projection=[Average Intensity]");
        selectWindow("AVG_C4-"+acq[i]);
        path = dir2+"Zproj-SHG-BGsubtr-"+acq[i]; //**
        run("Save", "save=&path"); //**
        close("*");
    }
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>