How to loop through all texframes of a selected artboard?
Hi, this seems pretty straight forward but just couldn't get it to work. I just want to loop through all textFrames in a selected artboard but my javascript code is returning all textFrames in the whole activeDocument. Would someone be able to shed some light?
var doc = app.activeDocument;
for (i=0; i<app.activeDocument.artboards.length; i++) {
doc.artboards.setActiveArtboardIndex(i); //selected an artboard
doc.selection = null; //clear selection
doc.selectObjectsOnActiveArtboard();
//loop thru' all textFrames in a selected artboard
for(var j = 0; j < doc.textFrames.length; j++){
text = doc.textFrames[j].contents; // <== but this line is returning all textFrames in the whole doc
alert(text);
}
}
