string proc on button command


#1

I’m having trouble using a button to run a proc. The proc is global and declared before the button. The line I’ve isolated is this:

button -label "Preview Bones" -command "Finger(Thumb)" ;	

the proc works outside of the GUI when all assets are in place. And depending on the format, when it’s plugged into the button command I get two separate errors. As shown above my error is this:

// Error: Invalid use of Maya object “Thumb”. //

when formatted this way:

    button -label "Preview Bones" -command "Finger("Thumb")" ;

I get this:

// Error: Too many arguments. Expected 1, found 2. //

The idea was to run one proc to create a finger with $name via something like this:
global proc Finger(string $name)

I’m fumbling through this so any pointers or help would be greatly appreciated.


#2
window -width 150;
columnLayout -adjustableColumn true;
    button -label "Button" -command "buttonPush(\"pCube1\")";
showWindow;

proc buttonPush(string $node)
{
        if (`objExists $node`) 
        {
            select $node;   
        }
}

#3

That fixed it… :keenly:

I sincerely appreciate your help.