Skip to main content
Inspiring
January 23, 2020
Answered

Layer Mask script in cc 2017 Error 8080

  • January 23, 2020
  • 4 replies
  • 910 views

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?

This topic has been closed for replies.
Correct answer Ghoulfool

I have no idea what was going aray!. But with a clean start it's now working fine. 

@Kukurykus - yup works fine on the background layer

@r-bin - Thanks for the heads up , but i've already got that covered with another function

4 replies

GhoulfoolAuthorCorrect answer
Inspiring
January 23, 2020

I have no idea what was going aray!. But with a clean start it's now working fine. 

@Kukurykus - yup works fine on the background layer

@r-bin - Thanks for the heads up , but i've already got that covered with another function

Legend
January 23, 2020
There should not be a mask on the layer when you run the script.
 
JJMack
Community Expert
Community Expert
January 23, 2020

The message states the command is not currently available. Why did you check? Why that may be?.  That there is a layer that a layer is targeted.  That the layer does not have a mask. That edit mode allows that layer to be masked, Photoshop command are not available for use if all the requirements do not exist.  You will see that message often when conditions are not what you think they are.

JJMack
Kukurykus
Legend
January 23, 2020

On new document (with background) in CC 2019 your code works with: make_layer_mask_active()