help me understand

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

stat

help me understand

Post by stat »

I want to read the parameters, where user puts in dialogue Color Range.
Fuzznes with all ok!
But with the rest of the parameters (Max L & Min L) - a mystery! Look!
Code: Select allcTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };

function DeSelect() {
var idsetd = charIDToTypeID( "setd" );
    var desc1563 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref31 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref31.putProperty( idChnl, idfsel );
    desc1563.putReference( idnull, ref31 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1563.putEnumerated( idT, idOrdn, idNone );
executeAction( idsetd, desc1563, DialogModes.NO );
};


function colorrange(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putInteger(cTID('Fzns'), 20);
    var desc2 = new ActionDescriptor();
    desc2.putDouble(cTID('Lmnc'), 31.22);
    desc2.putDouble(sTID("a"), 0.86);
    desc2.putDouble(sTID("b"), 0.31);
    desc1.putObject(cTID('Mnm '), cTID('LbCl'), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(cTID('Lmnc'), 95.34);
    desc3.putDouble(sTID("a"), 54.59);
    desc3.putDouble(sTID("b"), 49.85);
    desc1.putObject(cTID('Mxm '), cTID('LbCl'), desc3);
    desc1.putInteger(sTID("colorModel"), 0);
    var desc4 = new ActionDescriptor();
    var desc4 = executeAction(sTID('colorRange'), desc1, dialogMode);
   
    var fuzz = desc4.getInteger(cTID('Fzns'));
   
    var min_d = new ActionDescriptor();
    min_d = desc4.getObjectValue (cTID('Mnm '));
    var max_d = new ActionDescriptor();
    max_d = desc4.getObjectValue (cTID('Mxm '));
    var min_l = min_d.getDouble (cTID('Lmnc'));
    var max_l = max_d.getDouble (cTID('Lmnc'));
    alert('fuzznes '+fuzz+'\n'+'min L='+min_l+'\n'+'max L='+max_l);
  };

colorrange(true,true);
DeSelect();

If I move "fuznes" in Dialog - all correctly.
If I touch the pipette at least one point, I get the same value L.
Why are they the same?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

stat

help me understand

Post by stat »

Sorry!
I'm understand!!!
one click in dialog = 1 point : min = max
more than 1 click : min<>max
i'm stupid!
)))