Scripting

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

Scripting

Tom Larkworthy
Is it possible to supply the Generic Dialog with answers before it is
called, thus stopping it asking the user for input?

I am piecing together functionality from a wide variety of sources of ImageJ
plugins. The plugin writers normally hide their state variables and there is
not usually programmatic access without changing the source code i.e. the
only way to use their plugins is through the GenericDialog and therfore User
interaction (I want to automate a lot of stuff). I really don't want to keep
adding other peoples altered source code to my repository if possible. I
thought perhaps there might be a sly way of forcing the GenericDialog to
return answers you set pogrammatically beforehand, stopping the dialog ever
appearing when another plugin is called. (just had a 2nd look, and I don't
think it is possible)

Anyone have any other ideas? One strategy could be the Robot, but if anyone
knows a slicker way I would be grateful.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: Scripting

dscho
Hi,

On Wed, 12 Jul 2006, Tom Larkworthy wrote:

> Is it possible to supply the Generic Dialog with answers before it is
> called, thus stopping it asking the user for input?

You can always do something like this:

        run("Name of the plugin", "param1=bla param2=bli");

The easiest way to set this up is to record a macro, then call a plugin
with exactly the values you want.

Of course, this works only if the plugin uses a GenericDialog.

Hth,
Dscho