4 Replies Latest reply on Jun 28, 2015 7:59 PM by cmcheng



      i got a lot of file, with alpha, let say 2 of those file, one name tree01.jpg, another tree01_a.jpg, is it possible create a action let my both file(and all other file tree02.jpg, tree02_a.jpg and etc) auto become png? tree01_a.jpg is alpha for tree01.jpg

        • 1. Re: action
          JJMack Most Valuable Participant

          It sounds like you want to process pairs of  jpeg files a create a third image png file. Where first jpeg is the content for the png and the second jpeg is the layer mask for the layer's transparency.  That process would require Photoshop  scripting and action can not do a process like that.

          • 2. Re: action
            cmcheng Level 1

            yes, that's exactly what i want, any resource/sample for the script?

            i got try action just now, it really cant make it.

            • 3. Re: action
              JJMack Most Valuable Participant

              There is a Photoshop Scripting forum. Search that forum forum on the topic of processing pairs.  Scripting is programming is not an easy task. Requires programming and photoshop skills. To be usable on Mac and PC it would require use of javascript,


              You may find a script or two you could modify to do your process.

              • 4. Re: action
                cmcheng Level 1

                any simple way to create a layer mask for a layer and paste a image to layer mask?

                here is my try.


                var sourceFolder1 = Folder("d:\P")

                var fileList1 = sourceFolder1.getFiles();



                var sourceFolder2 = Folder("d:\P2")

                var fileList2 = sourceFolder2.getFiles();


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


                  if(fileList1[i] instanceof File)


                  var docRef1 = open(fileList1[i]);

                  var layerRef1 = docRef1.artLayers.add();


                  if(fileList2[i] instanceof File)



                  var docRef2 = open(fileList2[i]);


                  app.activeDocument = docRef1;






                let say filelist1 is "tree01.jpg " my source image, filelist2 is "tree01_a.jpg", my alpha image, now i only can copy tree01_a.jpg to my tree01.jpg as new layer, but i want copy tree01_a.jpg as a mask for tree01.jpg.