• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Apply Filter to Multiple Layers At Once (without converting to a SO)

Explorer ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

Hey everyone,

I've looked everywhere for a way to simply apply the same filter to multiple layers at once, without first converting them to a Smart Object. I need to keep my layers intact and separate from the others. Does anyone know of a script or a way to do this?

Any reply is much appreciated.

-Andy

TOPICS
Actions and scripting

Views

4.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Aug 11, 2015 Aug 11, 2015

Paul has a script "Filter Selected Layers" on site that does most filters.

It's at the bottom of the "PSCS Scripts" section.

http://www.ps-bridge-scripts.talktalk.net/

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

You would have to apply the filter to each layer. You can use scriptlistener to record the filter settings, then use a loop to go through and apply them to the selected layers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

Hi Chuck, thanks for your response,

I'm not a scripter myself. I do have the listener, but if you would be so kind, what's the actual syntax of what you're describing?

the SL gave me this when I applied my .3 px gaussian blur to a given layer, that I would like to apply to multiple layers:

// =======================================================

var idAdobeScriptAutomationScripts = stringIDToTypeID( "AdobeScriptAutomation Scripts" );

    var desc1 = new ActionDescriptor();

    var idjsNm = charIDToTypeID( "jsNm" );

    desc1.putString( idjsNm, """ScriptListenerOn""" );

    var idjsMs = charIDToTypeID( "jsMs" );

    desc1.putString( idjsMs, """[ActionDescriptor]""" );

executeAction( idAdobeScriptAutomationScripts, desc1, DialogModes.NO );

// =======================================================

var idGsnB = charIDToTypeID( "GsnB" );

    var desc2 = new ActionDescriptor();

    var idRds = charIDToTypeID( "Rds " );

    var idPxl = charIDToTypeID( "#Pxl" );

    desc2.putUnitDouble( idRds, idPxl, 0.300000 );

executeAction( idGsnB, desc2, DialogModes.NO );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

The ideal way to do this would be to get some script that records your selected layers. There is some on this site, but you will have to search for it. It's a little involved - lengthy code. But basically, you would make a loop and loop through the layers and then apply the code you got from script listener. Something like this which will apply the filters to all top level layers, which is most likely what you don't want, but it will show you the structure:

var doc = activeDocument;

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

     try{//the try will prevent the script from stopping if you try and apply the blur to layers that can't be blurred

          doc.activeLayer = doc.layers;

          gBlur()//putting your code in a separate function, keeps things neat and less cluttered.

     }

     catch(e){}

}

function gBlur(){

var idGsnB = charIDToTypeID( "GsnB" );

    var desc2 = new ActionDescriptor();

    var idRds = charIDToTypeID( "Rds " );

    var idPxl = charIDToTypeID( "#Pxl" );

    desc2.putUnitDouble( idRds, idPxl, 0.300000 );

executeAction( idGsnB, desc2, DialogModes.NO );

}//end function

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

Paul has a script "Filter Selected Layers" on site that does most filters.

It's at the bottom of the "PSCS Scripts" section.

http://www.ps-bridge-scripts.talktalk.net/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 11, 2015 Aug 11, 2015

Copy link to clipboard

Copied

Philip you are the man! Paul has some great stuff on his site that I will definitely make use of. Thanks so much!


Chuck I also greatly appreciate your info as well, I will put that in my back pocket for scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2019 Jun 01, 2019

Copy link to clipboard

Copied

LATEST

I just stumbled over this post, Paul's scripts have moved:

GitHub - Paul-Riggott/PS-Scripts: Photoshop Scripts

However, I can't see the script referenced above.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines