global proc groupSelected() {
// script to group each object selected to itself.
// select groups at end.
string $selObj[];
string $groups[];
string $obj;
string $newGroup;
$selObj = ls -sl;
for ($obj in $selObj) {
$newGroup = group -n ($obj+"\_Group") $obj;
$groups[(size($goups)] = $newGroup;
}
select $groups;
}
// now to use it, just call "groupSelected" (no quotes)
// better yet, drag the command from the script editor to the shelf, and just click it every time.