you run that code in the python script editor, or you make a python shelf button with that code, and use that to run it. for it to work, the python file i have in the first post, must be in your maya scripts directory. python is a case sensitive language, so that could be your problem. if it works the UI looks like this