4 Replies Latest reply on Jun 15, 2018 1:19 AM by Kukurykus

    Script run for multi layer same name

    ANCHINGO Level 1

      I have a script

      function doesLayerExist(layers, name) {
          for (i=0; i<layers.length; i++) {
              if (layers[i].name==name) return true;
          }
          return false;
      }
      
      
      if (doesLayerExist(app.activeDocument.layers, "MTN")) {
          // command
      }
      
      
      
      
      
      

      But it run for one layer name "MTN", not run for multi layer name "MTN".

      Please help me fix it.

       

      Thank in advance!!!