From http://stackoverflow.com/questions/17685388/selecting-textframes-inside-of-a-group-in-indesign-cs6 by Jongware
allframes = app.activeDocument.allPageItems;
textframes = [];
for (i=0; i<allframes.length; i++)
{
if (allframes[i] instanceof TextFrame)
textframes.push(allframes[i]);
}
alert (textframes.length);