6 Replies Latest reply on Apr 22, 2015 11:22 PM by Harbs.

    How apply an character style to all document including all objects (Tables, etc)??

    marios69201808

      I`ve tried these lines but nothing happened, it doesnt apply my char style "DOERJ"

      ANY TIPS...

       

      var myStories = app.activeDocument.stories.everyItem().getElements();

      for (var i = 0; i < myStories.length; i++) {

          var myTextFrames = myStories[i].textFrames;

          for (var j = 0; j < myTextFrames.length; j++) {

              if (myTextFrames[j].contents !== "") {

                  myTextFrames[j].texts[0].appliedCharacterStyle = "DOERJ";           

                  //alert("storie=" + i + "/n textframe=" + j)

                  var myTexts = myTextFrames[j].texts;

                  for (var n=0; n < myTexts.length; n++){

                      myTexts[n].appliedCharacterStyle = "DOERJ";

                     // alert(n);

                  }

              }

          }

      }