我使用了activeDocument.mergeVisibleLayers();
,但这不是我想要的,因为它不包括其他层。在Photoshop快捷方式中,我曾经使用Ctrl + Shift + Alt + E。有人知道该怎么做吗?
应该有一个布尔值告诉PS是否要使层变平,但是在DOM代码中通常没有这种情况。救援AM代码!
var desc = new ActionDescriptor();
desc.putBoolean(charIDToTypeID('Dplc'), true); // true to merge to new, false to flatten
executeAction(charIDToTypeID('MrgV'), desc, DialogModes.NO);