Answered
Why do I get the error "TextFrame is undefined" ?
Why do I get the error "TextFrame is undefined" when for instance a shape selected?
var doc = app.activeDocument;
var textRef = doc.selection[0]; // assume text frame is selected
alert(textRef.typename);
if (!(textRef instanceof TextFrame)) {
return;
}
