This is a Mel script for Maya I made to answer a question on polycount.
What it does is loop through selected objects and sets the smooth mesh vertex boundary value to 'sharp edges' instead of 'sharp edges and corners'.
It is also an example of a basic script that sets attributes on the shape node - you could switch the attributes for any others without any problems. To use it, make a new button in the shelf editor, and copy and paste the below code into the command window.
//set smoothing boundary script
//first get selected meshes
string $meshes[] = `ls -sl -tr`;
//loop through transforms
for( $mesh in $meshes) {
string $meshShapes[] = `listRelatives -s -f $mesh`;
//loop through shapes setting the value
for( $shape in $meshShapes){
setAttr ($shape + ".osdVertBoundary") 2; //this sets the vertex boundary on the OpenSubdivControls
}
}