2 Replies Latest reply on Sep 9, 2015 4:27 AM by hamdifem

    on layer object count

    hamdifem Level 1

      How do I find the number of the text frame objects on a layer style applied

       

       

      var myDoc = app.activeDocument; 
      var myLayer = myDoc.layers.item("Katman 1"); 
      for (var i = 0; i < myDoc.allPageItems.length; i++) {
      var myObj = myDoc.allPageItems[i];
      if(myObj instanceof TextFrame && myObj.appliedObjectStyle == "tmc"){
      var myCount = myLayer.pageItems.length; // ???   only "tmc" must count style
      }
      }
      alert(myCount);