What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

moving group (of layers) from one psd to another using action?


foxdog175

Member
Messages
7
Likes
0
Is it possible to automatically transfer a group of layers that use blending modes from one psd to other files via Batch?

I have ~500 jpg textures. They each need a group of shading layers added to them from a specific psd (on top of a ton of other steps to my action that work just fine). The quickest way to do that obviously is just to use an action and Batch Process. However, I'm not able to find a way to transfer that group from one psd to my textures since some of the layers use blending modes.

So, basically I have an action that performs a lot of different steps and the last thing I need to add to it is the ability to drag (or place) a group of layers from one psd to each individual texture in my Patch Process.

What I've tried:
1) I've tried using File/Place… to insert my psd containing the group on top of the texture, but Placing a psd converts everything into a Smart Object, which ignores all of the individual layers/blending modes.
2) I've tried moving the Shading group from the Kitchen PSD into the texture file, but actions don't seem to record moving layers/groups between PSD's.
3) I've tried duplicating the shading group and making the "Destination" the texture file, but that won't work dynamically as it looks for a certain file name to duplicate the folder to. To counter this, I thought I could immediately save the texture as "temp.psd", then run through all of the other actions, including the duplicate-to-destination function (which would find temp.psd and put the folder there). But then I run into the issue of not being able to use the Override Save option in Batch Processing, which means I couldn't dynamically save each file with a specific naming convention.

---

Does anyone have any ideas of what I could add to my action that would allow me to place the psd's group in each texture? I'm running out ideas…maybe a script of some sort?

Any help on the subject would be GREATLY appreciated. If there's any confusion, just let me know and I'll do my best to clarify.

Thanks!
Bret
 
This should do it...
It does require that only the working document is open!

Code:
#target photoshop
function main(){
if(documents.length != 1) return;
// Open psd with the layers to copy
//Amend filename to suit
var PSD = new File("/c/folderName/folderName/LayersToCopy.psd");
if(!PSD.exists) return;
open(PSD);
selectAllLayers();
activeDocument.activeLayer.duplicate(documents[0]);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
function selectAllLayers() {
    var desc29 = new ActionDescriptor();
        var ref23 = new ActionReference();
        ref23.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc29.putReference( charIDToTypeID('null'), ref23 );
    executeAction( stringIDToTypeID('selectAllLayers'), desc29, DialogModes.NO );
}
main();
Merry Christmas.
 

Back
Top