79790914

Date: 2025-10-15 08:01:29
Score: 1
Natty:
Report link

I've modified my code to the following:

var sel = app.activeDocument.selection;
for (var i = 0; i < sel.length; i++) {
    if (sel[i].typename === "TextFrame") {
        sel[i].textRange.characterAttributes.textFont = textFonts.getByName("ArialMT");
    }
}

Which outputs an alert:

Error 21: undefined is not object.
Line:16
-> if(sel[i].typename==="TextFrame"){

I select the text

My edition is 28.1 (64bit).

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user31690192