passing an array ,as a string, into a "run" command in macro language

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

passing an array ,as a string, into a "run" command in macro language

Gabriel Acevedo
Hello,
  This may be silly question, but I need help with
creating a macro. I am trying to use the "Substack
Maker"plugin in my macro.

In the macro recorder it shows up as the following:

run("Substack Maker", "slices=1,4,5,6,7,9")

my goal is to run a loop to create the desired list of
numbers in an array, and then use that list for the
slice list.

What I have not been able to do is figure out how to
pass that array into the "run" command above. I tried
various iterations of

run(.....,"slices="+(array name))

but it doesn't seem to work.
Does anyone have any suggestions?

Thanks,

Gabriel

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: passing an array ,as a string, into a "run" command in macro language

Wayne Rasband
You have to convert the array of numbers into a string. Here is an
example:

      for (i=0; i<arr.length-1; i++)
         str = str + arr[i] + ",";
     str = str + arr[arr.length-1];
     run("Substack Maker", "slices="+str);

-wayne

On Sep 27, 2006, at 3:57 PM, Gabriel Acevedo wrote:

> Hello,
>   This may be silly question, but I need help with
> creating a macro. I am trying to use the "Substack
> Maker"plugin in my macro.
>
> In the macro recorder it shows up as the following:
>
> run("Substack Maker", "slices=1,4,5,6,7,9")
>
> my goal is to run a loop to create the desired list of
> numbers in an array, and then use that list for the
> slice list.
>
> What I have not been able to do is figure out how to
> pass that array into the "run" command above. I tried
> various iterations of
>
> run(.....,"slices="+(array name))
>
> but it doesn't seem to work.
> Does anyone have any suggestions?
>
> Thanks,
>
> Gabriel
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>