Scripting parameters in Action Bar plugin

Tags: #<Tag:0x00007fb883d2a8a0> #<Tag:0x00007fb883d2a3f0> #<Tag:0x00007fb883d29f90>


I am looking for a way to make scripting parameters work, within Action Bar macro code. My attempts failed, so I tried it above all lines, but this time, It doesn’t recognize the variable.


// @String name
var name = name;
run("Action Bar","/plugins/ActionBar/testbar.ijm");
<button> 1 line 1
label=test button
arg= print(name);
// end of file

Do you know if there is a way to browse/obtain file path with GUI, from Action Bar code?



The current version of Action Bar (shipped via the IBMP-CNRS update site) is not compatible with SciJava script parameter syntax yet.

I filed a pull request a while ago, and Jerome Mutterer merged my commit, but didn’t upload to the update site yet, as it seems.
I now uploaded a pre-release to my own fork of the project. You can download the linked action_bar-2.0.5-SNAPSHOT.jar and replace your ./ by the new version. Then the following should work:

<button> 1 line 1
label=test button
// @String name

(EDIT: I invited Jerome Mutter, the author of Action Bar, to join the discussion on this forum topic.)


I actually wrote an email to him, also, asking about a possible solution to this. Its a very useful plugin, worth further development. I would like to thank to you too, I will immediately try your work.

Its too bad that commands have no getdirectory kind of property. All I need is to get a directory, get a filename and its path, and a few integer inputs, which are all very nicely handled by scripting parameters.


Oh, you can always use the ImageJ 1.x getDirectory() macro function :slight_smile:

But of course, the SciJava script parameters have been introduced to make things easier, so you don’t have to worry about creating, populating and showing a dialog.


Yes I was using it before realizing existence of script params, now I cannot go back to plain old getdirectory() :slight_smile:

By the way, your plugin seems working beautifully, with exception of a minor problem. My Fiji already has Action Bar 2.02, and installing yours caused some kind of conflicts (duplication messages etc), also, I dont know which plugin stays active and grabs “ijm” block during execution.

Is there a short way to uninstall previous version of Action Bar? I went to Update Fiji, Show details, Advanced Mode, find old action bar in the list, uninstall, etc… Would be good if it could be installed as an update to existing action bar, or any other suitable method to prevent such conflict, for users.


Hi everyone,
Very good news the the parameters thing is working fine. I apologise for not updating to Jan’s version yet, but I still have a small issue with it, in that the example bars that are shipped with the plugin are not found from within the jar file, because of complying with the new package structure. I will try to solve this again. Maybe I should ship them as separate files.


I see, thanks @jerome.mutterer!

Yep, it should be possible using the SciJava utilities to easily retrieve scripts from the resources in a jar file, and also auto-create menu commands from them to load the example bars. Maybe @ctrueden can give a quick hint on how to best achieve this. We might peruse the ScriptService for this.

You can uninstall plugins and jar files using the updater, but in this case it might not be aware that action_bar.jar and the new jar file are actually two versions of the same thing. In this case, you’ll have to manually tell the updater to Uninstall, or manually delete the jar file from your ./ and restart ImageJ/Fiji.


Hi @jerome.mutterer, any updates on Action Bar ? :slight_smile:


A script inside a JAR file at /scripts/Foo/Bar/My_Script.js will appear in the ImageJ menu as Foo :arrow_forward: Bar :arrow_forward: My Script, where Foo/Bar is any menu path of any depth >= 1, and .js can be any supported SciJava script language.

I admit I haven’t really looked into the Action Bar, so I don’t know whether this feature is applicable here. If not, feel free to describe your requirements and I can comment on whether/how the SciJava framework could help with that.


Hi @jerome.mutterer, Hi @all
@oburri and I would be very interested by using the SciJava script parameters.

Even if, it’s does’nt work (yet) within a jar file, it could make our life easier :smiley:

Do you have any update for us ?




BTW @imagejan, using your “pre-release” we noticed that :

  • using the tag <ijm> </ijm> we have access to SciJava script parameters BUT it prevents us to use functions from the ActionBar <codeLibrary> </codeLibrary>


-using the tag <macro> </macro>, we have access to functions from the <codeLibrary> </codeLibrary> but can’t use SciJava script parameters

Thanks a lot for your help with this !


This workaround described by @oburri “solves” my issue for the moment.

Using only the <macro> tag, I can call functions within the action bar <code library> and call an external ijm macro containing SciJava parameters.