The activeDocument.mergeVisibleLayers();
command simply flattens the image to the Background layer.
I am looking for a way to merge all layers to a new layer which stays on top of all other layers, like the Layer->Merge Visible (Ctrl+Shift+E) Photoshop command.
Is that possible?
2
Answers
Not sure if this is the best solution but it worked for me:
The answer by George does not work well with tranparent images (it crops the transparency and aligns the pasted image to the middle). Here is a script that simply executes the Merge Visible command, found with the Scripting Listener plug-in: