Re: How to determine availability of tools and plugins

Posted by Herbie on
URL: http://imagej.273.s1.nabble.com/How-to-determine-availability-of-tools-and-plugins-tp5022692p5022693.html

Dear Stein,

re 2. I use:

function check4Plugins() {
   nmeArray = newArray( "Plugin-name#1", "Plugin-name#2" );
   List.setCommands;
   for ( i=0; i<nmeArray.length; i++ ) {
     if ( List.get(nmeArray[i]) == "" ) {
     exit( "The ImageJ-PlugIn \"" + nmeArray[i] + "\" must be installed!" );
     }
   }
}

I faintly remember that Wayne has recommended this or a similar approach.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::::
Am 21.11.19 um 21:15 schrieb Stein Rørvik:

> I have two questions:
>
>
>    1.  Is there any way by macro or JavaScript to determine if a given tool(set) is loaded?
> That is, available as icon(s) in the toolbar, but not necessarily active/selected.
> I want to notify the user in a macro if a missing tool needs to be loaded.
>
>    2.  Is there any way by macro or JavaScript to determine if a given plugin is available?
> That is, available in the menus so that it can be called using run("<Plugin Name>").
> I want to notify a user if a needed plugin is missing, with instructions where to get it.
>
> Yes I know that 2) would be possible by parsing the output from List.setCommands;
> I just wondered if there is a more direct way to do it. The toolset I want loaded for 1)
> has some macros installed, but they do not appear in List.setCommands.
>
> Stein
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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