I have this script for building layers as smart objects in Layers in Photoshop. I followed a pretty good video on YouTube showing how to add a script, but in the video the person uses a .jsx file. So I assumed I'd have to copy this script into a Text Editor and save it as a .jsx file. I did that using Script Editor on the Mac. I saved it onto my computer but when I direct Photoshop to the script it is greyed out. I suppose it's not possible to allow sharing of files on the forum. I'll keep trying. Incidentally, I've been trying to open files as Smart Objects in Layers with Lightroom, I assume it's also not possible with Adobe Camera Raw?
// LayerPasteAllToOne.jsx
//
http://forum.luminous-landscape.com/index.php?topic=122780.msg1022848#msg1022848 // Save the file anywhere - desktop for testing
// name it LayerPasteAllToOne.jsx
// What it does is copy the active layer from each open file to the first file
// then closes all the other files
// regards john beardsworth
var AllDocs = app.documents;
if (AllDocs.length > 1) {
var itemDoc = null;
var otherDocs = Array();
for (var m = 1; m < AllDocs.length; m++) {
var aDoc = app.documents[m];
app.activeDocument = aDoc ;
var actLay = aDoc.activeLayer;
//change the layer name to the file's name
var docName = aDoc.name;
actLay.name = docName.replace('-1','');
//copy the layer or smart object to the first file
actLay.duplicate ( app.documents[0] );
//app.refresh();
// populate an array of the other files
otherDocs.push(app.documents[m]);
}
//now close all the other files
for (var m = 0; m < otherDocs.length; m++) {
app.activeDocument = otherDocs[m] ;
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
} else {
alert ("No other documents open")
}
//copy this line too - this is the end