close the window : Synchronize Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

close the window : Synchronize Windows

SUBSCRIBE IMAGEJ Marie-Laure B
Hi,
I work with a macro with Sync Windows, and I would like to close this windows after having working with it.
A piece of the macro :

                 run("Synchronize Windows");
                 run("Close");
                 showMessage("Synchronize Windows close ? ");

Thank you for your help,

Marie Laure

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: close the window : Synchronize Windows

Michael Schmid
Hi Marie-Laure,

you could try the following:

if (getBoolean("Synchronize Windows close ? ")) { //ask the user
  selectWindow("Synchronize Windows");
  run("Close");
}

The trick is that
  run("Close");
in contrast to close() also closes non-Image Windows.

Depending on what you want the user to do, you might also want to have a waitForUser command instead of the getBoolean; it will allow the user to do selections or measurements in the synchronized windows etc., e.g.

  waitForUser("Select ... in the two windows\nThen press OK");
  selectWindow("Synchronize Windows");
  run("Close");


As far as I can say, the buttons, checkboxes etc. of the "Synchronize Windows" panel cannot be controlled by macros.

Michael
________________________________________________________________
On Oct 8, 2014, at 17:44, SUBSCRIBE IMAGEJ Marie-Laure B wrote:

> Hi,
> I work with a macro with Sync Windows, and I would like to close this windows after having working with it.
> A piece of the macro :
>
>                 run("Synchronize Windows");
>                 run("Close");
>                 showMessage("Synchronize Windows close ? ");
>
> Thank you for your help,
>
> Marie Laure
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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