Skip to main content
Participant
April 17, 2024
Answered

Script to modify the blending mode of all layer groups in a file

  • April 17, 2024
  • 2 replies
  • 492 views

Greetings,

 

Can anyone help me with a Photoshop script that sets the blending mode of each and every layer group in a file to Pass Through?

(I have some PSD files exported from another application and for some reason the groups are all set to Normal blending mode. As a result, the artwork doesn't look right. I need to change them all to Pass Through.)

 

Thank you!

This topic has been closed for replies.
Correct answer r-bin
change_mode(activeDocument.layerSets);
alert("Done");

function change_mode(sets)
    {
    try {
        for (var i = 0; i < sets.length; i++) 
            {
            sets[i].blendMode = BlendMode.PASSTHROUGH;
            change_mode(sets[i].layerSets); 
            }
        }
    catch (e) { alert(e.line+ "\n\n" +e);  }
    }

2 replies

Participant
April 18, 2024

Hello this is Mr.Brian Nicholas Buono and I'm hearing impaired as profoundly deaf myself anyway, I would like to talk with you all about many things we can open to discuss over about this as my please and thank you likewise!

r-binCorrect answer
Legend
April 18, 2024
change_mode(activeDocument.layerSets);
alert("Done");

function change_mode(sets)
    {
    try {
        for (var i = 0; i < sets.length; i++) 
            {
            sets[i].blendMode = BlendMode.PASSTHROUGH;
            change_mode(sets[i].layerSets); 
            }
        }
    catch (e) { alert(e.line+ "\n\n" +e);  }
    }
Tudor_VVAuthor
Participant
April 18, 2024

Thank you!