Login  Register

closing non-picture windows from a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

closing non-picture windows from a macro

danibodor
this is probably a very futile question, but I am new to building macros in imagej.

I have a macro that is measuring all kinds of stuff for me and then at the end of the run i want to close the log, roimanager and results windows. I already know that the close() function does not work for this, because as it states on the site: "This function has the advantage of not closing the "Log" or "Results" window when you meant to close the active image. "

So how do you close these windows from a macro?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: closing non-picture windows from a macro

BenTupper
On Apr 6, 2009, at 9:08 AM, danibodor wrote:

> this is probably a very futile question, but I am new to building  
> macros in imagej.
>
> I have a macro that is measuring all kinds of stuff for me and then  
> at the end of the run i want to close the log, roimanager and  
> results windows. I already know that the close() function does not  
> work for this, because as it states on the site: "This function has  
> the advantage of not closing the "Log" or "Results" window when you  
> meant to close the active image. "
>
> So how do you close these windows from a macro?

Hi,

I just trief to close the ROI Manager using the File > Close menu with  
the macro recorder running.  It outputs the following command...

run("Close");

... and close the ROI Manager.


Cheers,
Ben
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: closing non-picture windows from a macro

Fabrice Senger
In reply to this post by danibodor
danibodor a écrit :
> this is probably a very futile question, but I am new to building macros in imagej.
>
> I have a macro that is measuring all kinds of stuff for me and then at the end of the run i want to close the log, roimanager and results windows. I already know that the close() function does not work for this, because as it states on the site: "This function has the advantage of not closing the "Log" or "Results" window when you meant to close the active image. "
>
> So how do you close these windows from a macro?
>  
you can try this :

 selectWindow("Results");
   run("Close");
selectWindow("ROI Manager");
run("Close");


Fabrice.

--
Senger Fabrice
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: closing non-picture windows from a macro

JorgeValero
In reply to this post by danibodor
This works perfectly for me:

list = getList("window.titles");
     for (i=0; i<list.length; i++){
     winame = list[i];
      selectWindow(winame);
     run("Close");
     }

Hope this helps someone,

Jorge Valero