Login  Register

xvfb and the @parameter notation

Posted by Avital Steinberg on Feb 02, 2017; 3:36pm
URL: http://imagej.273.s1.nabble.com/xvfb-and-the-parameter-notation-tp5017996.html

Hi,
In Java 6, the getArgument() command can accept arguments from the command
line. It works both in Javascript and also in .ijm macros. However, in Java
8, getArgument() doesn't work in both .ijm macros and Javascript scripts.

My Javascript script that used to work well with xvfb in Java 6 was:

importClass(Packages.ij.IJ);

var NAME = getArgument();
IJ.log("The argument you sent was:" + NAME);

I used to send an argument from the command line using xvfb like this:

xvfb-run -a [Path_to_ImageJ]/ImageJ -b '[Path_to_script]/getArg.js Lisbon'
> {path_to_log]/getParamArgJ6

However, the getArgument() command doesn't work in ImageJ Java 8 macros and
Javascript scripts. (as opposed to Java6 macros and Javascript scripts in
which it works)

So I want to use the @parameter notation to get a string argument from the
command line using xvfb.

If my script is:

// @String NAME
importClass(Packages.ij.IJ);

IJ.log("The argument you sent was:" + NAME);

How would I write an xvfb command that would get the String argument?

Thanks,
Avital

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