Login  Register

Re: User input for a global variable in a macro?

Posted by mmettlen on Jan 24, 2014; 5:22pm
URL: http://imagej.273.s1.nabble.com/User-input-for-a-global-variable-in-a-macro-tp3694344p5006267.html

Related to this, I have a macro using:

Dialog.create("Intensity values");
Dialog.addNumber("C1min:", 2);
Dialog.addNumber("C1max:", 10);
Dialog.addNumber("C2min:", 2);
Dialog.addNumber("C2max:", 10);
...
Dialog.show();

a = Dialog.getNumber();
b = Dialog.getNumber();
c = Dialog.getNumber();
d = Dialog.getNumber();
....

As shown, each time I run the macro, the default values '2' and '10' are shown in the dialog box. Is there any way that the macro, when it runs the next time, replaces/recalls these values with the last user input (i.e. a, b, c, d, ....)?

Thx, Marcel