Where the DOM is lacking, there is AM (Action Manager) code:
var idCnvM = charIDToTypeID( "CnvM" );
var desc5609 = new ActionDescriptor();
var idT = charIDToTypeID( "T " );
var desc5610 = new ActionDescriptor();
var idPlt = charIDToTypeID( "Plt " );
var idClrP = charIDToTypeID( "ClrP" );
var idAdpt = charIDToTypeID( "Adpt" );
desc5610.putEnumerated( idPlt, idClrP, idAdpt );
var idClrs = charIDToTypeID( "Clrs" );
desc5610.putInteger( idClrs, 128 );
var idFrcC = charIDToTypeID( "FrcC" );
var idFrcC = charIDToTypeID( "FrcC" );
var idBanW = charIDToTypeID( "BanW" );
desc5610.putEnumerated( idFrcC, idFrcC, idBanW );
var idTrns = charIDToTypeID( "Trns" );
desc5610.putBoolean( idTrns, true );
var idDthr = charIDToTypeID( "Dthr" );
var idDthr = charIDToTypeID( "Dthr" );
var idDfsn = charIDToTypeID( "Dfsn" );
desc5610.putEnumerated( idDthr, idDthr, idDfsn );
var idDthA = charIDToTypeID( "DthA" );
desc5610.putInteger( idDthA, 75 );
var idIndC = charIDToTypeID( "IndC" );
desc5609.putObject( idT, idIndC, desc5610 );
executeAction( idCnvM, desc5609, DialogModes.NO );
Or put through the CleanSL script:
var c2t = function (s) {
return app.charIDToTypeID(s);
};
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
descriptor2.putEnumerated( s2t( "palette" ), c2t( "ClrP" ), s2t( "adaptive" ));
descriptor2.putInteger( s2t( "colors" ), 128 );
descriptor2.putEnumerated( s2t( "forcedColors" ), s2t( "forcedColors" ), s2t( "blackAndWhite" ));
descriptor2.putBoolean( c2t( "Trns" ), true );
descriptor2.putEnumerated( s2t( "dither" ), s2t( "dither" ), s2t( "diffusion" ));
descriptor2.putInteger( s2t( "ditherAmount" ), 75 );
descriptor.putObject( s2t( "to" ), s2t( "indexedColorMode" ), descriptor2 );
executeAction( s2t( "convertMode" ), descriptor, DialogModes.NO );
In this case, the code was recorded via the ScriptingListener plug-in:
https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html
... View more