To adjust the hue, saturation and lightness in an adjustment layer, I have this "raw" code, obtained from the listener:
Code: Select allvar idsetd = charIDToTypeID( "setd" );
var desc72 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref62 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref62.putEnumerated( idAdjL, idOrdn, idTrgt );
desc72.putReference( idnull, ref62 );
var idT = charIDToTypeID( "T " );
var desc73 = new ActionDescriptor();
var idClrz = charIDToTypeID( "Clrz" );
desc73.putBoolean( idClrz, true );
var idAdjs = charIDToTypeID( "Adjs" );
var list53 = new ActionList();
var desc74 = new ActionDescriptor();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idCmps = charIDToTypeID( "Cmps" );
desc74.putEnumerated( idChnl, idChnl, idCmps );
var idH = charIDToTypeID( "H " );
desc74.putInteger( idH, 33 );
var idStrt = charIDToTypeID( "Strt" );
desc74.putInteger( idStrt, 50 );
var idLght = charIDToTypeID( "Lght" );
desc74.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list53.putObject( idHsttwo, desc74 );
desc73.putList( idAdjs, list53 );
var idHStr = charIDToTypeID( "HStr" );
desc72.putObject( idT, idHStr, desc73 );
executeAction( idsetd, desc72, DialogModes.NO );
But the code above is for when you have the Colorize option selected. If you have Colorize selected and you want to adjust the layer but also to go from Colorize to non-Colorize mode (i.e.. deselect the Colorize option), then the AM code becomes huge:
Code: Select allvar idsetd = charIDToTypeID( "setd" );
var desc88 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref63 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref63.putEnumerated( idAdjL, idOrdn, idTrgt );
desc88.putReference( idnull, ref63 );
var idT = charIDToTypeID( "T " );
var desc89 = new ActionDescriptor();
var idClrz = charIDToTypeID( "Clrz" );
desc89.putBoolean( idClrz, false );
var idAdjs = charIDToTypeID( "Adjs" );
var list28 = new ActionList();
var desc90 = new ActionDescriptor();
var idH = charIDToTypeID( "H " );
desc90.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc90.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc90.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc90 );
var desc91 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc91.putInteger( idLclR, 1 );
var idBgnR = charIDToTypeID( "BgnR" );
desc91.putInteger( idBgnR, 315 );
var idBgnS = charIDToTypeID( "BgnS" );
desc91.putInteger( idBgnS, 345 );
var idEndS = charIDToTypeID( "EndS" );
desc91.putInteger( idEndS, 15 );
var idEndR = charIDToTypeID( "EndR" );
desc91.putInteger( idEndR, 45 );
var idH = charIDToTypeID( "H " );
desc91.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc91.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc91.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc91 );
var desc92 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc92.putInteger( idLclR, 2 );
var idBgnR = charIDToTypeID( "BgnR" );
desc92.putInteger( idBgnR, 15 );
var idBgnS = charIDToTypeID( "BgnS" );
desc92.putInteger( idBgnS, 45 );
var idEndS = charIDToTypeID( "EndS" );
desc92.putInteger( idEndS, 75 );
var idEndR = charIDToTypeID( "EndR" );
desc92.putInteger( idEndR, 105 );
var idH = charIDToTypeID( "H " );
desc92.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc92.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc92.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc92 );
var desc93 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc93.putInteger( idLclR, 3 );
var idBgnR = charIDToTypeID( "BgnR" );
desc93.putInteger( idBgnR, 75 );
var idBgnS = charIDToTypeID( "BgnS" );
desc93.putInteger( idBgnS, 105 );
var idEndS = charIDToTypeID( "EndS" );
desc93.putInteger( idEndS, 135 );
var idEndR = charIDToTypeID( "EndR" );
desc93.putInteger( idEndR, 165 );
var idH = charIDToTypeID( "H " );
desc93.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc93.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc93.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc93 );
var desc94 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc94.putInteger( idLclR, 4 );
var idBgnR = charIDToTypeID( "BgnR" );
desc94.putInteger( idBgnR, 135 );
var idBgnS = charIDToTypeID( "BgnS" );
desc94.putInteger( idBgnS, 165 );
var idEndS = charIDToTypeID( "EndS" );
desc94.putInteger( idEndS, 195 );
var idEndR = charIDToTypeID( "EndR" );
desc94.putInteger( idEndR, 225 );
var idH = charIDToTypeID( "H " );
desc94.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc94.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc94.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc94 );
var desc95 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc95.putInteger( idLclR, 5 );
var idBgnR = charIDToTypeID( "BgnR" );
desc95.putInteger( idBgnR, 195 );
var idBgnS = charIDToTypeID( "BgnS" );
desc95.putInteger( idBgnS, 225 );
var idEndS = charIDToTypeID( "EndS" );
desc95.putInteger( idEndS, 255 );
var idEndR = charIDToTypeID( "EndR" );
desc95.putInteger( idEndR, 285 );
var idH = charIDToTypeID( "H " );
desc95.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc95.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc95.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc95 );
var desc96 = new ActionDescriptor();
var idLclR = charIDToTypeID( "LclR" );
desc96.putInteger( idLclR, 6 );
var idBgnR = charIDToTypeID( "BgnR" );
desc96.putInteger( idBgnR, 255 );
var idBgnS = charIDToTypeID( "BgnS" );
desc96.putInteger( idBgnS, 285 );
var idEndS = charIDToTypeID( "EndS" );
desc96.putInteger( idEndS, 315 );
var idEndR = charIDToTypeID( "EndR" );
desc96.putInteger( idEndR, 345 );
var idH = charIDToTypeID( "H " );
desc96.putInteger( idH, 0 );
var idStrt = charIDToTypeID( "Strt" );
desc96.putInteger( idStrt, 0 );
var idLght = charIDToTypeID( "Lght" );
desc96.putInteger( idLght, 0 );
var idHsttwo = charIDToTypeID( "Hst2" );
list28.putObject( idHsttwo, desc96 );
desc89.putList( idAdjs, list28 );
var idHStr = charIDToTypeID( "HStr" );
desc88.putObject( idT, idHStr, desc89 );
executeAction( idsetd, desc88, DialogModes.NO );
After studying the differences, I realized that when you go from Colorize to non-Colorize mode, the AM code seems to have to populate the Master/Colors drop-down box with all its probably default values and this drop-down box has 6 colors to populate!
My question is: do I really need to use this enormous code everytime I go from Colorize to non-Colorize mode, even if I am not using this option (Master/Colors) in my adjustment, i.e., even if I am always using default values for the Master/Color options?