Hi Wayne,
Your code worked perfectly fine, then i tried adding mine into it and it worked fine too.
After a bit of looking through my code I found the problem. I had a selectWindow("Results"); command in there. Took it out and everything works fine now. Its usually always something simple:)
Thanks
Cam
________________________________________
From: Rasband, Wayne (NIH/NIMH) [E] [
[hidden email]]
Sent: Saturday, July 13, 2013 5:12 AM
To: Cameron Nowell
Subject: Re: Stop Results Table taking Focus
Dear Cameron ,
On Jul 11, 2013, at 8:27 PM, Cameron Nowell wrote:
> Hi All,
>
> I have a macro that measures membrane intensities in a time series, all works exactly as I want. But it does take a while (even in batch mode) so it would be nice to have it run in the background while the user is doing other things (grant rebuttals, paper writing etc). The problem is that the results table keeps taking focus from other programs which results in send a very strange combination of key presses to ImageJ, breaking the run.
I am not able to reproduce this problem on my Mac laptop using this simple test macro. The Results table does not take focus from other programs when this macro is running. How does it work on your system?
setBatchMode(true);
newImage("Untitled", "8-bit ramp", 500, 500, 1);
for (i=0; i<100; i++) {
run("Measure");
wait(1000);
}
Best regards,
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html