run("Duplicate...") in a macro records 'selectWindow'

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

run("Duplicate...") in a macro records 'selectWindow'

Jan Eglinger-5
Dear all,

when I run:

  run("Duplicate...", "title");

in an ImageJ macro, the recorder records:

  selectWindow("title");

whereas nothing should be recorded when the command is started from a
macro. I tried to spot the bug in ij.plugin.filter.Duplicater.java , but
couldn't find it there.

Anyone else observed this behavior?

Jan
Reply | Threaded
Open this post in threaded view
|

Re: run("Duplicate...") in a macro records 'selectWindow'

Gabriel Landini
On Sunday 27 September 2009, Jan Eglinger wrote:
> when I run:
>   run("Duplicate...", "title");
> in an ImageJ macro, the recorder records:
>   selectWindow("title");

Yes I can replicate that under linux.

I also have encounter a few other commands that also get recorded when run
from a macro, such as :
roiManager("Add");
roiManager("Delete");

There might be some more, but I cannot remember right now.
Although most users would not encounter this problem, if one creates new
commands as macros, then of course the recorder will have those extra
unexpected commands.
This can be avoided by just inserting the code in the new macro instead of
recording but that is besides the point you raised.

Regards

G.
Reply | Threaded
Open this post in threaded view
|

Re: run("Duplicate...") in a macro records 'selectWindow'

David Webster
In reply to this post by Jan Eglinger-5
Do you mean that the recorder somehow gets started on its own or that this
happens when you have started the recorder yourself. I get this behavior
when I run the macro when I hae also turned on the recorder. I am using
windows xp and imageJ 1.43f

David Webster

On Sun, Sep 27, 2009 at 9:05 AM, Jan Eglinger <[hidden email]> wrote:

> Dear all,
>
> when I run:
>
>  run("Duplicate...", "title");
>
> in an ImageJ macro, the recorder records:
>
>  selectWindow("title");
>
> whereas nothing should be recorded when the command is started from a
> macro. I tried to spot the bug in ij.plugin.filter.Duplicater.java , but
> couldn't find it there.
>
> Anyone else observed this behavior?
>
> Jan
>
Reply | Threaded
Open this post in threaded view
|

Re: run("Duplicate...") in a macro records 'selectWindow'

Wayne Rasband
In reply to this post by Jan Eglinger-5
 > Dear all,
 >
 > when I run:
 >
 >   run("Duplicate...", "title");
 >
 > in an ImageJ macro, the recorder records:
 >
 >   selectWindow("title");
 >
 > whereas nothing should be recorded when the command
 > is started from a macro. I tried to spot the bug in
 > ij.plugin.filter.Duplicater.java , but couldn't find it there.
 >
 > Anyone else observed this behavior?

This bug is fixed in the v1.43h daily build.

-wayne
Reply | Threaded
Open this post in threaded view
|

run("Close") in a macro sometimes records 'close();'

Jan Eglinger-5
Dear Wayne,

thanks for the quick bug-fixing!
Just adding to that, when the Macro Recorder is open:


  saveAs("Measurements", "/path/to/filename.xls");

gets recorded as such even when called from inside a macro.
And:

  run("Close");

records "close();" when it happens to close an image window, but nothing
when it closes a results window (when called inside a macro of course).
(This turns out to be quite useful when debugging a macro that closes
the wrong window, but I guess it is not the intended behaviour.)

When being run from inside a macro, I think none of them should get
recorded at all.

Best,
Jan


Wayne Rasband wrote:

>> Dear all,
>>
>> when I run:
>>
>>   run("Duplicate...", "title");
>>
>> in an ImageJ macro, the recorder records:
>>
>>   selectWindow("title");
>>
>> whereas nothing should be recorded when the command
>> is started from a macro. I tried to spot the bug in
>> ij.plugin.filter.Duplicater.java , but couldn't find it there.
>>
>> Anyone else observed this behavior?
>
> This bug is fixed in the v1.43h daily build.
>
> -wayne