Login  Register

problem with getArgument() in macro

Posted by Michael Elbaum on Mar 19, 2020; 3:51am
URL: http://imagej.273.s1.nabble.com/problem-with-getArgument-in-macro-tp5023067.html

I'm running a macro from the linux command line and trying to pass it a filename, as in

./Image -macro mymacro.ijm mystack.tif

At the top of the macro I have the lines:

arg = getArgument();
print(arg);
open(arg);

All works as expected if I invoke ImageJ from the directory containing mystack.tif.

However it if sits in another directory, arg is printed but the file is not found, so

./Image -macro mymacro.ijm dir/mystack.tif does not work.


Is there a reason for this, and might it be fixed?


thanks,
Michael

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html