@CottonandTwirls – As I think about this, an action might be able to do so, however, it would be messy... Here is a script that should achieve what you are looking for:
/*
https://community.adobe.com/t5/photoshop-ecosystem-discussions/can-you-select-multiple-layers-in-a-document-and-have-them-all-duplicate-to-unique-documents/td-p/12957700
Dupe Selected Layers to New Docs.jsx
v1.0 - Stephen Marsh, 22nd May 2022
Note: No checks are performed for the selected layer kind, ensure that the correct layers are selected!
*/
#target photoshop
function main() {
var s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var lrs = executeActionGet(r).getList(p),
sel = new ActionReference();
for (var i = 0; i < lrs.count; i++) {
sel.putIdentifier(s2t('layer'), p = lrs.getReference(i).getIdentifier(s2t('layerID')));
(r = new ActionReference()).putIdentifier(s2t('layer'), p);
(d = new ActionDescriptor()).putReference(s2t("target"), r);
executeAction(s2t('select'), d, DialogModes.NO);
// Set the parent doc
var origDoc = activeDocument;
// RegEx remove illegal filename characters from document name
var docName = activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|\\\r\\\n.]/g, ""); // "/\:*?"<>|\r\n" -> "-";
// Layer name
var layerName = activeDocument.activeLayer.name;
// Show only the current layer
toggleActiveLayerVisibility(true);
// Duplicate the current layer to a new doc
dupeLayer();
// Return to the parent doc
activeDocument = origDoc;
}
/* Functions */
// Dupe active layer to new doc
function dupeLayer() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putClass(s2t("document"));
descriptor.putReference(s2t("null"), reference);
// Duped document name
descriptor.putString(s2t("name"), docName);
reference2.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
descriptor.putReference(s2t("using"), reference2);
// Duped layer name
descriptor.putString(s2t("layerName"), layerName);
descriptor.putInteger(s2t("version"), 0);
executeAction(s2t("make"), descriptor, DialogModes.NO);
}
// Toggle active layer visibility
function toggleActiveLayerVisibility(toggleOptionsPalette) {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var list = new ActionList();
var reference = new ActionReference();
reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
list.putReference(reference);
descriptor.putList(s2t("null"), list);
descriptor.putBoolean(s2t("toggleOptionsPalette"), toggleOptionsPalette);
executeAction(s2t("show"), descriptor, DialogModes.NO);
}
}
app.activeDocument.suspendHistory("Dupe Selected Layers to New Docs.jsx", "main()");
Saving & Installing Scripts:
- Copy the code text to the clipboard
- Open a new blank file in a plain-text editor (not in a word processor)
- Paste the code in
- Save the text file as .txt
- Rename the file extension from .txt to .jsx
- Install or browse to the .jsx file to run (see below)
More here:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop