Photoshop: Load multiple layers into separate smart objects

  • 1
  • Idea
  • Updated 1 year ago
  • (Edited)
It would be useful to be able to load multiple images into separate smart layers in a single step.  Seems like there could be an option on the Load Files into Stack script, or when dragging from a file list, to create a smart object for each layer.   I realize this likely has been suggested before, but I'll add my voice to the chorus.  Thanks.
Photo of Zolt Levay

Zolt Levay

  • 1 Post
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Max Johnson

Max Johnson, Champion

  • 495 Posts
  • 242 Reply Likes
Cannibalized a bit of code from this post and added a few lines...

save the script below as something like convertEachLayerToSmartObject.jsx and run it. Should convert all your selected layers to smart objects individually, rather than as a big group.

function convertEachLayerToSmartObject(){
var resultLayers=new Array();
var idGrp = stringIDToTypeID( "groupLayersEvent" );
var descGrp = new ActionDescriptor();
var refGrp = new ActionReference();
refGrp.putEnumerated(charIDToTypeID( "Lyr " ),charIDToTypeID( "Ordn" ),charIDToTypeID( "Trgt" ));
descGrp.putReference(charIDToTypeID( "null" ), refGrp );
executeAction( idGrp, descGrp, DialogModes.NO );
for (var ix=0;ix< llen; l++ ) {
app.activeDocument.activeLayer = resultLayers[l]
executeAction(stringIDToTypeID('newPlacedLayer'), undefined, DialogModes.NO);
return resultLayers;

Photo of Jaroslav Bereza

Jaroslav Bereza

  • 810 Posts
  • 188 Reply Likes
Can this settings solve your request?

If you drag images from Windows folder into document canvas, then each image is separate smart object layer. It works for me.
Photo of Colin Cheer

Colin Cheer

  • 1 Post
  • 0 Reply Likes
When I try that script I get "Error 15: Try without catch or finally. Line:18". I am running PS 2017.1.1 on windows 10. This one works though: