http://imagej.273.s1.nabble.com/Close-all-but-active-window-tp5014024p5017579.html
Hi Michael,
Sorry for responding late. I just checked Javascript with your command, it works quite well :). Thanks a lot. This saves me a lot of time.Thanks again for your explanation of backslashes. It was worth to learn it.
One question, are we able to choose two window (two Images) by using selectwindow (). I would like to keep two or three.. window open (Among several images) in order to do process on them and close others. like:
IJ.selectWindow("Stack1.tif");
IJ.selectWindow("Stack2.tif");
IJ.runMacro("print(\"work\");close(\"\\\\Others\");print(\"done\");");
As you know selectWindow() just considers last window then close all. Is there any way to select more than one window ?
Thank you in advance,
Haleh
De: "Michael Schmid-3 [via ImageJ]" <
[hidden email]>
À: "Haleh" <
[hidden email]>
Envoyé: Jeudi 10 Novembre 2016 22:13:33
Objet: Re: Close all but active window
Hi Haleth,
oops, sorry, I see, it's a matter of backslashes. The Javascript (or
java) code should be
IJ.runMacro("print(\"work\");close(\"\\\\Others\");print(\"done\");");
The Javascript interpreter (or Java compiler) converts the quadruple
backslashes to double, the macro interpreter double to single. At the
end of all conversions, a single backslash is required.
Michael
________________________________________________________________
On 2016-11-10 11:48, Haleh wrote:
> Hi Michael,
>
> Thanks a lot for your prompt response and help.
> I just tried your command to run macro from script (
> IJ.runMacro("close(\"\\Others\");"); ). It seems working well as It doesn't
> give any error. But at the end I noticed that It does not close other
> windows. In fact, it seems that program is running without considering this
> command.
>
>
> Regards,
>
> Haleh
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Close-all-but-active-window-tp5014024p5017556.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html