Hi robsmith01,
This is one way:
var compoundPathItems = app.activeDocument.compoundPathItems;
for (var i = 0; i < compoundPathItems.length; i++) {
compoundPathItems[i].name = "found you, number " + i;
}
Just put your own string in place of "found you, number " + i.