Layer Mask script in cc 2017 Error 8080
It's been a while... Did I miss the memo or something? You know, about layer masks and scripting in CC2017?
My previous code and recent ScriptListener code no longer seem to work to create layer masks
function make_layer_mask_active()
{
// make layer mask
// =======================================================
var idMk = charIDToTypeID( "Mk " );
var desc409 = new ActionDescriptor();
var idNw = charIDToTypeID( "Nw " );
var idChnl = charIDToTypeID( "Chnl" );
desc409.putClass( idNw, idChnl );
var idAt = charIDToTypeID( "At " );
var ref123 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
ref123.putEnumerated( idChnl, idChnl, idMsk );
desc409.putReference( idAt, ref123 );
var idUsng = charIDToTypeID( "Usng" );
var idUsrM = charIDToTypeID( "UsrM" );
var idRvlA = charIDToTypeID( "RvlA" );
desc409.putEnumerated( idUsng, idUsrM, idRvlA );
executeAction( idMk, desc409, DialogModes.NO );
// Make it active
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc410 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref124 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref124.putEnumerated( idChnl, idOrdn, idTrgt );
desc410.putReference( idnull, ref124 );
var idMkVs = charIDToTypeID( "MkVs" );
desc410.putBoolean( idMkVs, true );
executeAction( idslct, desc410, DialogModes.NO );
}
I get the following error:
Error 8800: General Photoshop error
occurred. This functionality may not be available
in this version of PhotoShop.
- The command “Make” is not currently available.
Line: 174
-> executeAction( idMk, desc1443, DialogModes.NO );
I even tried JJ Mack's script here
Was some functionality replaced or removed in CC2017? Is there a way around this?
