activeDocument.selection = null;
var txtObj = activeDocument.textFrames;
for (var i = 0; i < txtObj.length; i++){
try{
txtObj[i].selected = true;
}catch(e){}
}

var selObj = activeDocument.selection;
for (var i = 0; i < selObj.length; i++){
if (selObj[i].typename == "TextFrame"){
alert(selObj[i].contents)
}
}