Run effect on each top level layer

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

norm

Run effect on each top level layer

Post by norm »

Hi all,

I've been plugin away trying to get this to work but cant seam to get it right. What Im trying to do is run an individual effect on each layer from the top level of the document, for example.

Layer 1 will have effect A applied

layer 2 will have effect B applied and so on up to the 30th layer

I plan to create each effect as a function, this is what I have so far.

Code: Select allfunction processLayers(){
   function getLayers( parent ){
   for( var m = parent.layers.length -1; m >= 0; m-- ){
   var layer = parent.layers[ m ];
          if (m == 1){
                 effect1();                   
          }else if(m == 2){
                effect2();
          }
      }
}
getLayers(app.activeDocument);
};

fuction effect1(){
effect script goes here.
}

fuction effect2(){
effect script goes here.
}



Id also like to ignore the background layer as well if thats possible.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

norm

Run effect on each top level layer

Post by norm »

No one got an idea how to do this?
Paul MR

Run effect on each top level layer

Post by Paul MR »

One option would be to create an actionset with your hundred or so different functions then you could use the index of the layer to select the action to run.