This command saves the specified shelf (first argument) to the specified file (second argument).
Derived from mel command maya.cmds.saveShelf
Example:
import pymel.core as pm
# Create a window with a shelf in it.
#
window = pm.window()
tabs = pm.tabLayout()
shelf = pm.shelfLayout()
pm.shelfButton( '\"Hello\\n\"")', image1='commandButton.png', command='("print' )
# Result: ui.ShelfButton('window1|tabLayout4|shelfLayout1|Hello_n___') #
pm.tabLayout( tabs, edit=True, tabLabel=(str(shelf),'Example Shelf') )
# Result: ui.TabLayout('window1|tabLayout4') #
pm.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.
#
tempDir = pm.internalVar( userTmpDir=True )
pm.saveShelf( shelf, (tempDir + 'ExampleShelf') );