Not Finding "retargetinglimblabel" Proc

Hey, not sure why this is not working, should a be a simple enough procedure to add some retargeting labels to joints..

CODE
proc retargetSkels(){

    // Joint retargeting labelling
    select "Root_"; // wildcard
    retargetingLimbLabel "Root";

    select -r "LegR_";
    retargetingSideLabel "Right";
    retargetingLimbLabel "Leg";

    select -r "LegL_";
    retargetingSideLabel "Left";
    retargetingLimbLabel "Leg";

    select -r "Chest_";
    retargetingLimbLabel "Spine";

    select -r "Neck_";
    retargetingLimbLabel "Neck";

    select -r "Head_";
    retargetingLimbLabel "Head";

    select -r "CollarR_";
    retargetingSideLabel "Right";
    retargetingLimbLabel "Arm";

    select -r "CollarL_";
    retargetingSideLabel "Left";
    retargetingLimbLabel "Arm";
}

But I get this error..

// Error: line 213: Cannot find procedure "retargetingLimbLabel". //

However this command was copied and pasted from the script editor through echo all commands.

Any ideas?

Thanks, Chris

usually this is because something has been sourced by maya when you did something.
look for source statements in the script editor.

otherwise type whatIs retargetingLimbLabel. if it returns nothing, redo what you did manually the first time, then use whatIs.
whatever it's a part of, you need to source.

Thanks Holographix, I had to use 'source ChaSkeletonsMenu'. Now it works if I do the procedure on its own, but now I get random syntax errors a few lines after where ever I put it, how could I go about including this into a larger script?

Thanks, Chris

EDIT: Yay can get away with running the window command...

'ChaSkeletonsMenu MayaWindow|mainSkeletonsMenu;'

Which appears to act as sourcing the script.

Cheers