How to check if a layer's vector mask is enabled or disabled?
I need to check if a layer's masks are disabled (by shift-clicking them in Photoshop, bringing a big red "X" on them).
So I came up with these functions:
function vectorMaskEnabled( _layerID ){
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), _layerID);
return executeActionGet( ref ).getBoolean( stringIDToTypeID( 'vectorMaskEnabled' ) );
}
function rasterMaskEnabled( _layerID ){
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), _layerID);
return executeActionGet( ref ).getBoolean( stringIDToTypeID( 'userMaskEnabled' ) );
}
For whatever reason, the rasterMaskEnabled function works, but the vectorMaskEnabled does not. It seems like "vectorMaskEnabled" is always true when there is a vector mask, regardless of its state (enabled or disabled), where "userMaskEnabled" works as expected.
Any idea why is that happening and how can I fix it? I just need to know if the vector mask is enabled or not.
