#target photoshop
function main(){
if(documents.length != 1) return;
// Open psd with the layers to copy
//Amend filename to suit
var PSD = new File("/Users/Avaris/Desktop/Current Project/!Memory Mates/HV/mm.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();