Implement #@script directive with most @Plugin attributes
As discussed with @ctrueden. This should enable scripts to be annotated like this:
#@script(name="coolscript", menuPath="Plugins>My Scripts>Cool Script")
with an optional shortcut to the name attribute:
#@script("coolscript")
Subtasks:
- [x] Check that named scripts have a better title bar on the dialog
- [ ] Make menuPath override folder structure; allow toplevel scripts if menuPath is set to something non-empty
- [ ] Enhance menuPath parsing (for ALL modules) to support shortcut key in brackets at the end, and weight in curly braces at the end
This might be resolved now with d9dce68bf18b4db0fb812e4685f44fb58d6a988e. But I did not test whether the menuPath is working as described above. @imagejan Want to check it out when you get a chance? Can this issue be closed as resolved? Or is further work needed?
Just an update: the menuPath issue is still not solved, scripts don't show up at the defined menu path, but at the one corresponding to their subfolder of ./scripts/.
Also, when running a script that contains a #@script directive, we currently get:
[WARNING] Ignoring invalid parameter: script ...
This is fixed on the script-imports-jan branch with https://github.com/scijava/scijava-common/commit/ad139e7849fbff316d42492da614b5eabeeda782 by giving a higher priority to ScriptDirectiveScriptProcessor, but we still need to tackle the menu path issue before closing this issue.
Is there any reason not to simply cherry-pick ad139e7 right now?
@ctrueden wrote:
Is there any reason not to simply cherry-pick ad139e7 right now?
There's no reason not to do that :slightly_smiling_face: I rebased onto master and opened PR https://github.com/scijava/scijava-common/pull/331 to address this.
Great! So all that's left now is the menu path issue, right?
Yes, we still need to sort out the menu path.