Auto code completion for IJ macro



I removed the "<a name=Dialog.getNumber></a>" from line 293, which was out of place, and the extra quote from line 2652.

I also added separate entries for close("*") and close("\\Others").


We may want to devise a strategy for keeping and in sync. The content of is layered into the toplevel domain, so e.g. is the same file as The entire is refreshed nightly from by a Jenkins job.

@Wayne Maybe it would make sense to copy the contents of over top the mirror after the mirror has completed? I.e.: we first mirror to, then copy over it to cover the situations where that content exists and is newer? How would you prefer things to be organized? I do not feel strongly, although I think users would like it if the content of the toplevel domain was as reliable and up-to-date as possible.


@ctrueden Just for curiosity: Might it be possible that the mirroring script/code commits the recent functions.html to github in case it detects changes? That would allow us removing the web pinging code from the autocompletion and get rid of the short hang when switching to macro language…


It would make sense to copy these files and directories:

The src and jars directories should be copied to

These files are updated more frequently than the corresponding versions on, which I can’t easily update.

I would make more files available at but I am unable to edit directories that contain an index.html file.


@Wayne A command added in 1.51a5 but missing from the functions page is Roi.getContainedPoints().



I added this description:

Roi.getContainedPoints(xpoints, ypoints)
Returns, as two arrays, the x and y coordinates of the pixels inside the current selection. Aborts the macro if there is no selection.

To the macro functions list at


Very timely release for my macro imagej course. Work great on Ubuntu 18.04, and no problem reported during this week imageJ macro course with attendees on Mac OS X and Windows 7/10.

One autocomplete error:
for (i = 0; i < 10, i++) { -> replaces the second semicolon by a comma.


Bertrand Vernay, PhD
Imaging Facility Manager
MRC Centre for Regenerative Medicine
SCRM Building
The University of Edinburgh
Edinburgh bioQuarter
5 Little France Drive
EH16 4UU

Office: +0044 (0)131 651 9543


Thanks @Bertrand_Vernay!

This one is fixed in the version which will become part of Fiji. :slight_smile:


Hi @haesleinhuepf

great release!

several more “hidden commands” that are missing.


and missing declarations macro "title"{ and var.



Hey @Kota,

thanks for the hint! I’ll list them. Regarding the var how does it work? I’ve never seen this thing… Is it for global variables or …?



Hi @haesleinhuepf,
var may be ancient, but still useful :wink:


Hey @eljonco,

thanks for the link. I really didn’t know that this exists :wink:

The really good thing about autocompletion is, you discover new things all the time :smile:



thanks to @eljonco for answering.


When a macro file contains multiple macros each with macro declaration (“macro set”), presuming that the macro is used by [Plugins > Macros > Install…], global variables declared using var is used.


Ok, its in.

Any more secret commands are welcome!

Furthermore, might there be people who would like to add custom/personalized snippets to the autocomplete plugin?:thinking:


Just some feedback after the first macro user training I’ve been doing since the introduction of code completion in the script editor - this is plainly awesome! The boost in usability of the macro language is impressive, this has been - by far - the best training workshop on macro programming I’ve been giving ever.

:arrow_forward: Thanks a lot for your efforts @haesleinhuepf, @ctrueden, @imagejan, @frauzufall, @dnmason, @oburri, @Wayne, @Kota and whoever else has been contributing to this!

:beers: :beer:


Just updated Fiji, started to write some code and saw the awesome autocomplete function.

I know nearly all standard functions by heart, but this still speeds up writing code a lot.

I’ve been waiting for 9 years for this function, I cannot thank you enough @haesleinhuepf !
For me as a user this is one of the best additions in years.



Thank you! It might also have been the best addition I’ve made to work for anything in years :wink:


I dunno man, you also helped spearhead the ImageJ search bar, which I find invaluable on a regular basis. :beers:


I don’t know if there’s an official Feature Request for autocomplete so I add it here, but is it possible to prevent autocomplete in comments?


Hi @dnmason

thanks for the suggestion. Also @Kota mentioned exactly the same thing just two days ago. I found a way how to do this.

Could you please be so kind and download the updated test/snapshot version of imagej-legacy jar from here, put it in the jars directory of your ImageJ/Fiji, delete the old imagej-legacy.jar and confirm that it’s working without negative side effects? We could then bring it on the way to a release.

Furthermore, here is the related pull request: