Login  Register

Re: Passing arguments to plugins in a macro

Posted by Du, Guanghua on Jan 27, 2010; 12:17pm
URL: http://imagej.273.s1.nabble.com/Passing-arguments-to-plugins-in-a-macro-tp3689580p3689583.html

what I have done is in my plugin there is a dialog to input the
parameters. after you have compiled the plugin, you can start the
"record marco" command, and then ,you run you plugin. from the marco
window, you will see how the command will be in your new marco.
something like:
run("plugin", "para1=value1 para2=value2 .....");

then you can write in your marco, use marcovalue1, marcovalue2 replace
those values in the run()command.


Simon Andrews wrote:

> I've written a plugin which puts up a configuration dialog in normal
> operation so the user can tweak the settings.  I want to be able to run
> this plugin from within a macro in a non-interactive way.
>
> I've tried to do this by parsing the arguments passed to the setup
> method - but I can't seem to get them to appear in the macro.
>
> For example if I put in the macro:
>
> run("My Plugin")
>
> The plugin runs and the args string is empty,
>
> but if I run:
>
> run("My Plugin","Some args")
>
> ..then the args String passed to the setup method is still empty.
>
> I'm sure I'm just misunderstanding how this works.  Could someone please
> explain how to pass data from a macro to a plugin.
>
> Thanks
>
> Simon.