Go to: Synopsis. Return value. MEL examples.

Synopsis

saveShelf string string

saveShelf is undoable, NOT queryable, and NOT editable.

This command saves the specified shelf (first argument) to the specified file (second argument).

Note that this command doesn't work well with controls that have mixed mel and python command callbacks. Also, because it saves the state to a mel file, it does not work with callbacks that are python callable objects.

Return value

booleanTrue if successful.

MEL examples

//    Create a window with a shelf in it.
//
string $window = `window`;
string $tabs = `tabLayout`;
string $shelf = `shelfLayout`;
shelfButton -image1 "commandButton.png" -command ("print \"Hello\\n\"");
tabLayout -edit -tabLabel $shelf "Example Shelf" $tabs;
showWindow $window;

//    At this point the example would be made more interesting if you
//    put some additional items on this shelf.

//    Now save the shelf in the temp directory.
//
string $tempDir = `internalVar -userTmpDir`;
saveShelf $shelf ($tempDir + "ExampleShelf");