Login  Register

Re: run() and Macro Recorder ignoring calls to getBoolean()

Posted by Herbie-4 on Jul 22, 2014; 9:40am
URL: http://imagej.273.s1.nabble.com/run-and-Macro-Recorder-ignoring-calls-to-getBoolean-tp5008839p5008846.html

Neil,

not perfectly sure if you speak about macros using Dialog-functions per
Dialog.create().

If so, Boolean parameters are passed in my case.
For example when I record one of my macros that asks for a choice per
pop-up menu, an integer number, a float number and finally a Boolean per
check-box, I get:

run(" ZonePlate", "style=Tapered support=128 oversampling=1.50 bipolar");

If the check-box "Bipolar" is left unchecked, I get:

run(" ZonePlate", "style=Tapered support=128 oversampling=1.50");

HTH

Herbie

::::::::::::::::::::::::::::::::::::
On 21.07.14 21:25, Neil Fazel wrote:

> I often invoke one .ijm macro from within another with help from the
> Macro Recorder. I first run the called macro interactively, then copy
> and paste into another macro whatever the Macro Recorder displays in
> the Recorder window. The Macro Recorder embeds arguments provided
> interactively by the user in the argument string it passes to the
> called macro. For example, if the called macro is MyMacro.ijm, and
> has two getNumber() calls in it to get arg1 and arg2, the Recorder
> shows this
>
> run("MyMacro", "arg1=8349 arg2=55");
>
> But any calls to getBoolean() do not show up in the argument list,
> e.g. something like
>
> run("MyMacro", "arg1=8349 arg2=55 arg3=true");
>
> is not generated. I tried inserting arg3=true by hand into the run()
> statement, but it was ignored by the called macro.
>
> It would be nice if run() and Macro Recorder could handle Boolean
> arguments.
>
> Thanks, Neil
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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