Posted by
Michael Schmid on
Jun 10, 2020; 5:09pm
URL: http://imagej.273.s1.nabble.com/installing-macro-properly-tp5023470p5023471.html
Hi Kenneth,
this works for me:
Installing the following macro
macro "<test> foo_macro" { print("test foo"); }
macro "<test> bar_macro" { print("test bar"); }
creates a Plugins>Macros>test submenu, with entries "foo_macro" and
"bar_macro".
If you want to have it directly in Plugins>... submenus, put the macro
file into the coresponding subdirectory of ImageJ/plugins and make sure
the file name contains an underscore. It should appear in the menu after
you restart ImageJ or after Help>Refresh Menus. I guess that only one
level of subdirectories ImageJ/plugins/... is allowed.
Michael
________________________________________________________________
On 10.06.20 18:57, Kenneth Sloan wrote:
> I apologize for being slow - but the documentation is confusing me. So, I'll pester you with a direct question about my specific problem.
>
> I have a file, "foo_macro.ijm" which looks like:
>
> macro "foo_macro" { ...stuff... }
>
> My usual routine with Java plugins is to use a "plugins.config" file in the .jar file. Typically, I drag&drop the .jar file, select a subfolder under plugins (to keep all my plugins in one place - mostly so it is easy to DELETE all of them when required), and restart FIJI. Works perfectly. The plugins.config file always looks like this:
>
> Plugins>category,"pretty name",className
>
> where "category" is a sub-menu under Plugins where I want "pretty name" to appear, and
> "className" is the name of the Java Class.
>
> I want to do something similar with this macro, but...
>
> drag&drop of foo_macro.ijm does not install the macro - instead it brings me into the editor
> so, OK - I'll use Plugins>Install Plugin. Note that I have rarely used this method, so I may completely mis-understand it.
>
> That works about as expected, except:
>
> a) there seems to be no way to select a subfolder of plugins - foo_macro.ijm is installed in plugins.
> I would like to put it in plugins/subFolder.
> b) I can't seem to get the macro to show up with a sub-menu - it shows up at the bottom, along with Debug and Sandbox and others. I would like it to show up as Plugins>subMenu>foo_macro.
>
> Following the documentation, I tried:
>
> macro "<subMenu> foo_macro" { ...stuff... }
>
> but this had no effect.
>
> What am I doing wrong?
>
> I think I can install the macro manually in a sub-folder (but I don't like to do that myself, and I definitely don't want to tell my colleagues to try to do this themselves).
>
> I have no clue how to get the macro to show up as Plugins>subMenu>foo_macro.
>
> My main sources so far have been the online tutorial and the example macro "MacroSubMenus.txt" - but clearly I'm not understanding them.
>
> Clues?
>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html