Menu entry for script provided via update site

Is there a way to provide a script through an update site and tune the menu entry as well? i.e. if I want a script to show up in a submenu. There is an assumption here that since it is a single-file (Clojure) script it isn’t possible to attach a plugins.config.

Thank you!

Any script in subfolders of ./plugins/Scripts/ will appear in a menu corresponding to the folder structure (provided the script file name contains at least one underscore “_”).

See for example the content of this folder in the Fiji repository:

In addition to @imagejan’s suggestion, it is also possible to create a JAR file which contains scripts and associated plugins.config file, using the Script_Launcher plugin. This plugin is an incomplete proof of concept because no one in the community has chosen to finish polishing it. But it should be relatively easy to do.

Aha… perfect. I’m going with @imagejan’s suggestion.

Just to highlight that I’m not completely crazy, there is a slightly odd behavior: I was specifically trying to make
Funimage>Segmentation>mycoolnewscript
by making the corresponding directory structure inside Scripts.

However, that never shows up, no matter what. Why? because I have BAR installed which has a “Segmentation” subfolder. If I rename to Funimage/Segmentation2, then it shows up.

I’ll just spell all my subfolders in l33t sp34k :smile:

@kephale That’s indeed a bug: I can hijack the Correct_3D_drift.py script from Fiji into my own folder by creating any other folder containing a subfolder Registration (e.g. BAR > Registration). I guess the scripts will end up in the folder that’s being parsed first, in alphabetical order.

EDIT: I opened an issue for this:

I believe the issue is now fixed via imagej/imagej-legacy#129. Please test and let me know.

1 Like

It works like a charm, thanks a lot!