First of all, I usually give controls names rather than rely on the ones that maya assigns. Makes life a lot easier Anyway, in your myProc you have defined $rButton twice. Also you're missing some parenthesis and whatnot in your radioButtonGrp -edit line... This should work: Code: global proc myProc(string $rButton) { int $nameButton; $nameButton = `radioButtonGrp -q -sl $rButton`; print $nameButton; } global proc TestGUIscript() { string $rButton; string $window = `window -wh 400 500 -title "Radio Test"`; rowLayout -nc 3; text " "; $rButton = `radioButtonGrp -numberOfRadioButtons 2 -label1 "Hierarchical" -label2 "Alphabetical"`; radioButtonGrp -edit -onCommand ("myProc(\"" + $rButton + "\")") $rButton; showWindow $window; }