Source command problem

Source command problem

Anonymous
Not applicable
411 Views
2 Replies
Message 1 of 3

Source command problem

Anonymous
Not applicable
Ok, I have a list of mel script names in an array called $list and I am trying to do the following:

for ($item in $list)
{
button -label $item -c "source $item";
}

But when I run the script it tells me I have a syntax error on the button line. I have tried a number of different punctuations and nothing works. Does anyone know what is wrong?
0 Likes
412 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
string $cmd = ("source " + $item);
button -label $item -c $cmd;
0 Likes
Message 3 of 3

Anonymous
Not applicable
Works perfect. Thanks a lot.
0 Likes