Within my macro, how do I test if a plugin is installed before calling it?

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

Within my macro, how do I test if a plugin is installed before calling it?

Alan Hewat
I am writing a macro to capture images from a number of different cameras,
correct them for lens distortion, and stitch them together to form a mosaic.

I would like to test if a plugin is installed before calling it with
run("PluginName",...) If I call it without testing if it exists, and it is
not installed I get an ImageJ alert "Unrecognized command: PluginName".

Thanks. Alan.
Reply | Threaded
Open this post in threaded view
|

Re: Within my macro, how do I test if a plugin is installed before calling it?

Wayne Rasband
On Aug 7, 2009, at 7:33 AM, Alan Hewat wrote:

> I am writing a macro to capture images from a number of different
> cameras,
> correct them for lens distortion, and stitch them together to form a
> mosaic.
>
> I would like to test if a plugin is installed before calling it with
> run("PluginName",...) If I call it without testing if it exists, and
> it is
> not installed I get an ImageJ alert "Unrecognized command: PluginName".

You can test to see if a plugin is installed using

    List.setCommands;
    if (List.get("PluginName")!="") {
       // plugin is installed
    }

This requires the v1.43f daily build, which adds the List.setCommands
macro function.

-wayne