Well, I can't test this fully 'cause I don't have UT nor UnrealEd but it seems that you have a semicolon missing in the script. select -r $objSelected[0] should be select -r $objSelected[0];