Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

if typename question

$
0
0

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];
};

Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>