我想从psd中找到所有剪切蒙版层。但是问题是我们如何在当前使用的以下代码中确定psd中的剪贴蒙版层。
我尝试了这个How to identify clipping masks in Photoshop using JavaScript
但是它不起作用。
directus_files
答案 0 :(得分:1)
var doc = activeDocument,
layers = activeDocument.layers;
for (var x = 0; x < layers.length; x++)
{
doc.activeLayer = doc.layers[x];
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var desc = executeActionGet(ref);
if (desc.hasKey(charIDToTypeID('Grup')) && desc.getBoolean(charIDToTypeID('Grup')))
{
alert("this is Clipping Mask Layer: " + doc.activeLayer.name);
}
}