getVertexCenter

Decided to do a MEL script for a change so I get the hang of that part to.
This one creates a locator in the middle of two selected vertices. Handy for getting the center point on geometry that has no obvious edges or other reference.
Try a cylinder with no top or bottom faces for instance. Just select two opposing vertices and a locator will appear in the center.

/*
##
## getVertexCenter
## -------------
## 14 jul 2009
## Jan-Erik "Jonne" Östman (jonne@jonne.net)
##
## www.jonne.net
##
## Description:
## ------------
## MEL script for geting the center of two vertices
##
##
## Instructions:
## -------------
## Select two vertices and the script will put up a locator in the
## center of the two vertices.
##
## -------------------------------------------------------------------------
*/


// Set selection and init variables
string $locators[];
clear $locators;
int $i=0;

string $sel[] = `ls -sl -fl`;

// Error checking
if (size($sel)!=2){
	warning ("Select 2 vertices");
} else {

	for ($obj in $sel) {
		float $vert[] = `pointPosition -w $obj`;	
	
		//Create locators and append all to an array
		string $loc[] = `spaceLocator`;
		$locators[ size($locators) ] = $loc[0] ;
	
		move -a $vert[0] $vert[1] $vert[2] $locators[$i];
		$i++;
	}

	$centerLoc = `spaceLocator -n "vertexCenterpivot"`;

	pointConstraint $locators[0] $centerLoc;
	pointConstraint $locators[1] $centerLoc;
	delete $locators;
}

I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein