Sorry if this is a silly question, but can anyone let me know why the if/else code below doesn't work?
The script is supposed to determine which out of two selected objects is a text frame and give it the variable 'text'
var docRef = app.activeDocument; if (docRef.selection[0].typename = "TextFrame"){ var text = docRef.selection[0]; var other = docRef.selection[1]; } else { var text = docRef.selection[1]; var other = docRef.selection[0]; };