Skip to main content
mo54891077
Participant
March 14, 2019
Answered

Script to Merge each main group (not subgroup) in to a layer

  • March 14, 2019
  • 1 reply
  • 4212 views

Hi

I have a client who wants to receive his image in the following format

one layer for the background

another layer for the shaddow

another layer for the object

I am doing many images so i am looking a way to Script to Merge each main group (not subgroup) in to a layer

then while i work i can make sure to work in these groups

is there a way to do it?

Thank you in advance

This topic has been closed for replies.
Correct answer SuperMerlin

Something like this?

#target photoshop;

while(app.activeDocument.layerSets.length){

activeDocument.activeLayer = app.activeDocument.layerSets[0];

executeAction(stringIDToTypeID("newPlacedLayer"), new ActionDescriptor(), DialogModes.NO);

activeDocument.activeLayer.rasterize(RasterizeType.ENTIRELAYER);

}

1 reply

SuperMerlin
SuperMerlinCorrect answer
Inspiring
March 14, 2019

Something like this?

#target photoshop;

while(app.activeDocument.layerSets.length){

activeDocument.activeLayer = app.activeDocument.layerSets[0];

executeAction(stringIDToTypeID("newPlacedLayer"), new ActionDescriptor(), DialogModes.NO);

activeDocument.activeLayer.rasterize(RasterizeType.ENTIRELAYER);

}

Participant
November 6, 2022

Excellent! 

Works perfectly!

 

Thanks!