Go to: Synopsis. Notes. Return value. MEL examples.


renameUI string string

renameUI is undoable, NOT queryable, and NOT editable.

This command renames the UI object passed as first arument to the new name specified as second argument. If the new name is a duplicate, or not valid, then re-naming fails and the old name is returned.


This command does not update other objects or commands that reference this object by name, so use this command at your own risk.

Return value

stringThe new name, or the old name if re-naming fails.

MEL examples

//    Create a window with a single button.
string $window = `window`;
button -label "Example" exampleButton;
showWindow $window;

//    Edit the button label.
button -edit -label "New Label" exampleButton;

//    Rename the button.
renameUI exampleButton newButton;

//    Query the button label using the new object name.
button -query -label newButton;