Is there a way to create an automated action or way of duplicating multiple layers so that each layer is duplicated into its own new document. Right now I have to manually right click, and click Duplicate Layer into New Document for each layer. Is there an Action that can be created to do this? Thank you.

enter image description here

1 Answer 1


Can be easily done with a simple script. Save this as a .jsx file to your PS folder > Presets > Scripts, after restarting PS it'll be available in the File > Scripts menu. Or simply use File > Scripts > Browse... to select the .jsx file saved anywhere.

var doc = activeDocument
var layers = doc.layers;
var layer;

for (var i = 0; i < layers.length; i++) {
  layer = layers[i];
  activeDocument = doc;
  doc.activeLayer = layer;

activeDocument = doc;

function docFromLayer(lname) {
    var desc240 = new ActionDescriptor();
        var ref2 = new ActionReference();
        ref2.putClass( stringIDToTypeID('document') );
    desc240.putReference( stringIDToTypeID('null'), ref2 );
    desc240.putString( stringIDToTypeID('name'), lname );
        var ref3 = new ActionReference();
        ref3.putEnumerated( stringIDToTypeID('layer'), stringIDToTypeID('ordinal'), stringIDToTypeID('targetEnum') );
    desc240.putReference( stringIDToTypeID('using'), ref3 );
    desc240.putString( stringIDToTypeID('layerName'), lname );
    executeAction( stringIDToTypeID('make'), desc240, DialogModes.NO );
  • 1
    Thanks. that helps save a lot of time. Nov 25, 2023 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.