Login  Register

Running an ImageJ macro in a java plugin

Posted by Avital Steinberg on Nov 13, 2014; 11:57am
URL: http://imagej.273.s1.nabble.com/Running-an-ImageJ-macro-in-a-java-plugin-tp5010403.html

Hi,
I am trying to run an ImageJ macro in a java plugin using IJ.runMacro. I
would like to understand how to pass the macro a string argument. The
following code doesn't work:

String simpleMacro =
    "String greeting = getArgument();"+
    "print(greeting);";

IJ.runMacro(simpleMacro,"hi");

What am I doing wrong? How can I pass the macro the string argument "hi"
and get the macro to print it?

Thank you,
Avital

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