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
Paul has a script "Filter Selected Layers" on site that does most filters.
It's at the bottom of the "PSCS Scripts" section.
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.
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 );
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
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.
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.
Copy link to clipboard
Copied
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.