Batch Mode/Active Image Ambiguity
Posted by David Webster on Mar 11, 2009; 8:27pm
URL: http://imagej.273.s1.nabble.com/Batch-Mode-Active-Image-Ambiguity-tp3693320.html
When running the included script with batch mode not set, I get
"4: active image is test2" from the final print statement. This jibes
with my intuition about what the active image should be at
this point. But, if I use "setBatchMode(true)", I get
"4: active image is test1". Why does using the batch mode cause
a shift in the active image? Is this correct? This caused me some
problems until I discovered what was going on and started using
selectImage() rather than depending on the default active image.
macro batchtest3 {
newImage("test1", "32-bit", 101, 101, 1);
//setBatchMode(true);
print("1: active image is ",getTitle());
img2="test2"; run("Duplicate...","title="+img2);
print("2: active image is ",getTitle());
img3="test3"; run("Duplicate...","title="+img3);
print("3: active image is ",getTitle());
selectImage(img3); close();
print("4: active image is ",getTitle());
} //End macro main
David Webster