Call an ImageJ macro from Netbeans
Posted by nath02 on
URL: http://imagej.273.s1.nabble.com/Call-an-ImageJ-macro-from-Netbeans-tp5009378.html
Hello everybody
I wrote a macro.txt on the ImageJ environment. It works very well when I call it with Plugins>Macro>Run.
Now, I'm writting a JAVA program on Netbeans 7.1.1. In this program, I really need to call macro.txt. That's why I'm using the IJ library with the following part of code :
String retval = "";
retval = IJ.runMacroFile(script);
When I do a print of "script", I get exactly the path+the name of the script.
But here is my problem, it compiles without any problem but when I execute my program, I get this error :
This plugin or macro requires ImageJ 1.41 or later.
I really don't understand because I have the 1.47v version of ImageJ installed on my computer. So, it should work ? To give you more information, I use the 1.6.0_20 (64-bit) version JAVA and Netbeans 7.1.1.
(also, I'm working on Windows 7). When I change the name of the macro, with a wrong one, I get this error : Macro file not found
I guess it means it's making a link with ImageJ ? Could you give me a clue to understand what happens ?
I have also tested with the "runMacro" function, and in this case, I get this error :
Undefined variable in line 1.
<C> : \ Users \ xxx \ Documents \ ImageJ \ plugins \ xxxscript . txt
But I don't understand because the macro exists at this place
Can you help me please ?
Thank you very much for all your advices !
Nath