Login  Register

Re: installing macro properly?

Posted by Wayne Rasband-2 on Jun 10, 2020; 11:23pm
URL: http://imagej.273.s1.nabble.com/installing-macro-properly-tp5023470p5023487.html

> On Jun 10, 2020, at 3:41 PM, Kenneth Sloan <[hidden email]> wrote:
>
> Wayne-
>
> Thanks for the prompt reply.
>
> I am using FIJI, and tried your suggestion to use Install instead of Install Plugin.
>
> That seemed to work as you described, but also (as I think you described), the plugin is not visible in any menu.

I did some more testing using Fiji and found if I use Plugins>Install… to install a macro in Plugins/Macros it does appear in the Plugins menu. I can, however, run the macro by entering its name in the search box and pressing return. I also found that if, in the second dialog, I click on “Create Folder” and create a “MyMacros” folder, my macro appears in the Plugins>MyMacros menu. Unexpectedly, “MyMacros” is listed near the bottom of the Plugins menu.

-wayne

>
> Is this a limitation for FIJI?  If so, I suppose I can live with it, but I really did like keeping all of my plugins in a separate plugins/subFolder.
>
> Using Install... and putting foo_macro.ijm in plugins, the macro is installed, and works - but it still shows up at the bottom of the Plugins menu. So, it is accessible as:
>
> Plugins>foo_macro
>
> Is there any way to make it appear in the menu as:
>
> Plugins>subMenu>foo_macro?
>
> The macro is written (as demonstrated by the example macro) as:
>
> macro "<subMenu> foo_macro" { ... stuff ... }
>
> but the <subMenu> seems to have zero effect.
>
> Is this another difference between ImageJ and FIJI?
>
> Is there another mechanism I can use to create Plugins>subMenu and install macros so they appear there?
>
> I realize that this is largely cosmetic, but I'm trying to understand how this all works.  Both the location of the macro (in a separate plugins/subFolder) and the appearance on the menu (at Plugins>subMenu) are things I would *like* to do - but neither are critical.
>
> Recall that my standard practice in the past was to install .jar files containing both Java classes and a "plugins.config" file.  That's the only mechanism I currently understand for manipulating the appearance of the menu structure.  Is there particular piece of documentation (for either ImageJ or FIJI - but FIJI is what we are using) which explains this?
>
> Hmmm...would it work to package foo_macro.ijm and a plugins.config file in a .jar file and try to install *that*?  Would this work in FIJI, if the .jar file were in plugins>subFolder?  Is there some *other* recommended place to install macros so that access to them looks just like access to Java plugins?
>
> Of course, if push came to shove, I could just take the macro and rewrite it in Java.  Perhaps that would be easier, all around.  
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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