Alert selection in illustrator
// InDesign & Illustrator
var firstListItem = app.activeDocument.selection[0]; // first object in selection
if(firstListItem instanceof TextFrame){ /* check the type */
alert("I am a " + firstListItem.constructor.name); // and name it
}
app.activeDocument.selection;