Login  Register

Re: Close all but active window

Posted by Michael Schmid on Nov 10, 2016; 9:45am
URL: http://imagej.273.s1.nabble.com/Close-all-but-active-window-tp5014024p5017554.html

Hi Haleh,

as far as I know, the close("\\Others") is only available in macro mode.
You can find the source code for the macro function here:

https://github.com/imagej/imagej1/blob/master/ij/macro/Functions.java#L2910

So, you can either try
   IJ.runMacro("close(\"\\Others\");");
<I did not try whether I've got the syntax with all the quotes etc. right>
or alternatively, you can replicate the loop for closing all images from
the source code I've mentioned above.

Michael
________________________________________________________________
On 2016-11-09 15:08, Haleh wrote:

> Hi,
>
> You have proposed for closing all image windows apart from the front image,
> it's better to use
> close("\\Others"). This command works well on marco recorder or... but can't
> use this command in script. I mean I have tried many ways such as
> (IJ.close("\\Others") , IJ.run("close\\Others") and so on...). But none of
> them works.
> Could you please help me how I can use close("\\Others") as an micromanager
> script?
>
> Thank you in advance,
> Haleh
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html