Hi all,
I have an illustrator document which has many text layers. I have found the script below that replace a text with another one in the document;
var doc = app.activeDocument;
var myTextFrames = doc.textFrames;
for (i = 0; i < myTextFrames.length; i++) {
var myTF_ByI = myTextFrames[i];
var str = myTF_ByI.contents
var res = str.replace("word1", "word2");
myTF_ByI.contents = res
}
However, there is one problem that the script also replaces the text in other layers even though they are hidden or locked. Could you help me adjust this script to be effective only for the selected or unhidden layer?
Cheers,
Akin