Antwort: Re: Call plugin with arg from macro

Posted by Joachim Wesner on
URL: http://imagej.273.s1.nabble.com/Colocalisation-tp3696413p3696419.html

Thanx for the different suggestions, after a little experimenting, I found
out
that what I suggested already works with the macro-recorder/replayer:

If you add extra args in the "options" string to IJ.run, that do not
correspond
to any dialog entries, they are simply ignored and you can extract and use
those
for special purposes wit Macro.getOptions(), other dialog options still
work
as before.

Very nice, that solved my problem!

Joachim

ImageJ Interest Group <[hidden email]> schrieb am 23.04.2008 08:23:38:

> Hi William,
>
> hmmm, I see, but this is the "options" string I mentioned that is also
used
> to passed Dialog options.
> In my special case I could pretty easily rewrite the macro to do what I
> want, (only one extra "option arg),
> but it´s not the arg string that the run()  method gets. Any way to
> directly set up that?
>
> Maybe one way would be to use a special "Arg=" keyword in the argument
> string, together with the
> macro recorder/replayer, in that case the fields will not be passed to
any

> dialog field when replayed,
> but to the arg string?
>
> I.e.
>
>    IJ.run("plugin1", "Arg=xxx Open=yyy Dialogopt=dlg");
>
> "Arg=xxx" will be cutoff and given to the arg string, the rest will
> work as before!
>
> Just an idea
>
> Thanx a lot.
>
> Joachim,


> I've passed an argument string from one plugin1 to plugin2 successfully.
> plugin1
> ,,,,,,,,,,,,,,,,,,,,
>    IJ.run("plugin1", "argument1");
> ....................
>
> plugin2
> ............................
>     String str =  Macro.getOptions();
> ............................
>
> This might well work running the plugin from a macro.  Wayne offered this
> method in a user reply some time ago.
> Cheers, Bill
>


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________