Variables in Macro Run Commands

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Variables in Macro Run Commands

TJ Krall
Hello all,

I'm writing a macro in which I'd like to call upon other macros using the run command (i.e. run("Grouped Stack Projector", "group=2 projectionfiltered=[Sum Slices]"); ).  However, instead of using the constant group size or entering the group size in manually each time, I'd like to use a variable.

run("Grouped Stack Projector", "group=variable projectionfiltered=[Sum Slices]");

 However, whenever I do so I get an error saying that the variable is not recognized as a number.  Before the "run" command I've written print(variable); and the number prints to the log window correctly.  I've also parsed the variable to an integer in case it was being stored as a string, which obviously didn't correct the problem. Anyone have any thoughts?


Thanks,
TJ
 
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.
Reply | Threaded
Open this post in threaded view
|

Re: Variables in Macro Run Commands

dscho
Hi,

On Sun, 17 Sep 2006, TJ Krall wrote:

> run("Grouped Stack Projector", "group=variable projectionfiltered=[Sum
> Slices]");

You have to concatenate the variable:

        "group=" + variable + " projectionfiltered=[Sum Slices]"

Hth,
Dscho