Re: User input for a global variable in a macro?
Posted by
Bill Mohler on
Dec 03, 2008; 3:14pm
URL: http://imagej.273.s1.nabble.com/User-input-for-a-global-variable-in-a-macro-tp3694344p3694346.html
Moving the initial declaration to the head of the file completely
solved my problem. Thanks!
>Bill,
>
>If I understand you correctly, then yes you can set global variables
>for a set of macros. You define the variables at the beginning of
>the macro outside any of the installable submacros. An example:
>
>var myNewVariable = "Hi Bill";
>
>macro "Read [1]"{
> Dialog.create("Enter Text");
> Dialog.addMessage("Enter some text");
> Dialog.addString("Text:", myNewVariable, 12);
> Dialog.show();
> myNewVariable = Dialog.getString();
>}
>
>macro "Write [2]"{
> print(myNewVariable);
>}
>
>Cheers
>
>Mike