5 Replies Latest reply on Sep 8, 2016 1:19 AM by elyasafo28436183

    "Save png from two different groups" this scripting is not working in Photoshop CC 2015.5

    sumank38193215 Level 1

      #target photoshop

       

       

      var doc=app.activedocument;

      var layer=doc.activeLayer;

      var group=layer.parent.layers;

       

       

      function SavePNG(){

          var pngOptions=new PNGSaveOptions();

          if (group[0].name==" "){

              var str=" ";

              }else{

                  var str="-"+grpup[0].name;

                  }

              var path=File(doc.path+"/"+Layer.name+str+".png");

              doc.SaveAs(path,pngOption,true,Estension.LOWERCASE);

              }

         

          function SwitchLayer(i){

              layer.visible=false;

              doc.activeLayer=group[i]

              layer=doc.activeLayer;

              layervisible=true;

              }

         

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

              SavePNG();

              if(i+1>=group.length){

                  break

                  }

              SwitchLayer(i+1);

              }

         

          SwitchLayer(1);

         

          alert("All Done!");