Trying to close a non-image window

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

Trying to close a non-image window

Philip Ershler
Why does this macro code fail in ImageJ64 1.44o? The window I'm trying to close results from

Image->Hyperstacks->Channel Tools->Channels->Split Channels

*************************************************************

  list = getList("window.titles");
  if (list.length==0)
     print("No non-image windows are open");
  else {
     print("Non-image windows:");
     for (i=0; i<list.length; i++)
        print("   "+list[i]);
  }

SelectWindow("Channels");
run("Close");

*************************************************************

The log shows

Non-image windows:
   Channels


The error Undefined identifier <SelectWindow> ("Channels")

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Trying to close a non-image window

Jerome Mutterer-3
Philip,
use selectWindow("Channels"); instead.
(lowercase s).

Jerome

On Mon, Feb 28, 2011 at 5:34 AM, Philip Ershler <[hidden email]>wrote:

> Why does this macro code fail in ImageJ64 1.44o? The window I'm trying to
> close results from
>
> Image->Hyperstacks->Channel Tools->Channels->Split Channels
>
> *************************************************************
>
>  list = getList("window.titles");
>  if (list.length==0)
>     print("No non-image windows are open");
>  else {
>     print("Non-image windows:");
>     for (i=0; i<list.length; i++)
>        print("   "+list[i]);
>  }
>
> SelectWindow("Channels");
> run("Close");
>
> *************************************************************
>
> The log shows
>
> Non-image windows:
>   Channels
>
>
> The error Undefined identifier <SelectWindow> ("Channels")
>
> Thanks