Copy link to clipboard
Copied
The layer is being duplicated from the photoshop javascript given below but it is not happening in the active document any help
var sourceDoc = activeDocument;
var sourceLayerName = sourceDoc.activeLayer.name;
var openDocCount = documents.length;
var targetDocIndex = openDocCount - 2;
var targetDocName = documents[targetDocIndex].name;
dupeLayer(sourceLayerName);
function dupeLayer() {
function s2t(s) {
return app.stringIDToTypeID(s);
}
var descriptor = new ActionDescriptor();
var list = new ActionList();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( s2t( "null" ), reference );
reference2.putName( s2t( "document" ), targetDocName );
descriptor.putReference( s2t( "to" ), reference2 );
descriptor.putString( s2t( "name" ), sourceLayerName );
descriptor.putList( s2t( "ID" ), list );
executeAction( s2t( "duplicate" ), descriptor, DialogModes.NO );
sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
}
Copy link to clipboard
Copied
Whatever document is open after the source document is closed, paste the selected layers in that document by whatever name it may be by any number.
modify this code