为每一层Photoshop脚本创建遮罩

时间:2018-10-13 10:54:15

标签: javascript photoshop photoshop-script

下面的代码正在为选定的图层创建遮罩,但是我想为每个图层创建遮罩。谁能帮我?感谢前进!

makeLayerMask('RvlS');



    function makeLayerMask(maskType) {
    if( maskType == undefined) maskType = 'RvlS' ; //from selection
    //requires a selection 'RvlS'  complete mask 'RvlS' otherThanSelection 'RvlS'
        var desc140 = new ActionDescriptor();
        desc140.putClass( charIDToTypeID('Nw  '), charIDToTypeID('Chnl') );
            var ref51 = new ActionReference();
            ref51.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
        desc140.putReference( charIDToTypeID('At  '), ref51 );
        desc140.putEnumerated( charIDToTypeID('Usng'), charIDToTypeID('UsrM'), charIDToTypeID(maskType) );
        executeAction( charIDToTypeID('Mk  '), desc140, DialogModes.NO );
    }

0 个答案:

没有答案