A veeery simple and badly coded example!
global proc myShelfSave(){
global string $tab;
print $tab;
string $shelfPath="C:/Users/Janne/maya/6.0/prefs/shelves/";
$tabs=tabLayout -q -ca $tab
;
for($shelf in $tabs){
saveShelf $shelf ($shelfPath + $shelf);
print $shelf;
}
}
{
global string $tab;
string $shelfPath="C:/Users/Janne/maya/6.0/prefs/shelves/";
string $shelves[]={"shelf_Animation","shelf_Custom"};
$win =window -h 400 -w 200
;
paneLayout -configuration "horizontal2" -ps 1 100 90;
$tab=tabLayout
;
for($shelf in $shelves){
shelfLayout $shelf;
eval("source ""+$shelfPath+$shelf+".mel"");
eval $shelf ;
setParent ..;
}
setParent..;
button -l "save" -c "myShelfSave";
showWindow;
}