Skip to main content
Inspiring
June 5, 2013
Question

How to make a one-color fill images with masks in documents from our multiple layers ?

  • June 5, 2013
  • 1 reply
  • 408 views

Hello everyone!

I`m to open PSD document with same layers. I need to:

1. Save the jpg file (preview) in a certain place

2. All layers with masks to make one-color fill instead of images with masks.

Thanks

This is way ?

var theLayers = collectLayers(app.activeDocument, []);

alert (theLayers.join("\n"));

function collectLayers (theParent, allLayers) {//---------------------------------------------------

if (!allLayers) {var allLayers = new Array}

   else {};

   for (var m = theParent.layers.length - 1; m >= 0;m--) {

      var theLayer = theParent.layers;

      if (theLayer.typename == "ArtLayer") {

           var bar = new Array;

           bar = theLayer.bounds

           l0= Math.abs(this.app.activeDocument.width - theLayer.bounds[2] - theLayer.bounds[0]);

           l1= Math.abs(this.app.activeDocument.height -theLayer.bounds[3] - theLayer.bounds[1]);

            if((l0+l1)>0) { // layer mask is set

                // delete this layer

 

                //create new layer

 

                //create new mask from array bar

 

                //fill selection

 

            allLayers.push(theLayer);

            }

         }

     };

   return allLayers

   };

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
June 5, 2013

I may not quite follow.

Would you mind posting an example (a screenshot with the Layers Panel visible for example) and an overview of the resulting images you want to produce?