string $obj,$com,$name,$newName; string $objects[]=`ls -type file`; for ($obj in $objects) { $com="getAttr "+$obj+".fileTextureName"; $name=eval($com); if (fileExtension($name)=="map") continue; $newName="sourceimages/"+basenameEx($name)+".map"; print ("Converting and copying '"+$name+"' to '"+$newName+"'\n"); $com="start imf_copy \""+$name+"\" \""+`workspace -q -rootDirectory`+$newName+"\""; print ("----------> "+$com+"\n"); system ($com); $com="setAttr -type \"string\" "+$obj+".fileTextureName \""+$newName+"\""; print ("-----------------> "+$com+"\n"); eval($com); print ($obj+".fileTextureName : "+$newName+"\n"); }