我用了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);