// =======================================================
// Blend if - write values
set (0, 10, 25, 25, 25, 25, 25, 25);
function set(srcBlackMin, srcBlackMax, srcWhiteMin, srcWhiteMax, destBlackMin, destBlackMax, destWhiteMin, Dstt) {
var c2t = function (s) {
return app.charIDToTypeID(s);
};
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var descriptor3 = new ActionDescriptor();
var list = new ActionList();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( c2t( "null" ), reference );
reference2.putEnumerated( s2t( "channel" ), s2t( "channel" ), c2t( "Grn " ));
descriptor3.putReference( s2t( "channel" ), reference2 );
descriptor3.putInteger( s2t( "srcBlackMin" ), srcBlackMin );
descriptor3.putInteger( s2t( "srcBlackMax" ), srcBlackMax );
descriptor3.putInteger( s2t( "srcWhiteMin" ), srcWhiteMin );
descriptor3.putInteger( s2t( "srcWhiteMax" ), srcWhiteMax );
descriptor3.putInteger( s2t( "destBlackMin" ), destBlackMin );
descriptor3.putInteger( s2t( "destBlackMax" ), destBlackMax );
descriptor3.putInteger( s2t( "destWhiteMin" ), destWhiteMin );
descriptor3.putInteger( c2t( "Dstt" ), Dstt );
list.putObject( s2t( "blendRange" ), descriptor3 );
descriptor2.putList( s2t( "blendRange" ), list );
descriptor.putObject( s2t( "to" ), s2t( "layer" ), descriptor2 );
executeAction( s2t( "set" ), descriptor, DialogModes.NO );
// alert ( s2t( "destWhiteMin" ) ); // не работает
}