I have a few years of experience with JavaScript/Web development programming but I’m new to ImageJ/Fiji. I’m trying to write a macro that ask the user to select a file to run on ImageJ 1.52r on top of Java 11.0.9.1 (64-bits).
I tried the solution provided at File open dialog in ImageJ Javascript Script and Open one or more image files from macro function but when I try to run it, I’m getting
TypeError: OpenDialog is not a function in <eval> at line number 3
The code that I’m running is
importClass(Packages.ij.io.OpenDialog);
od = OpenDialog("Choose a file", null);
folder = od.getDirectory();
file = od.getFileName();
path = folder + file
Thanks for the help.