Skip to main content
raxby
Inspiring
October 31, 2017
Question

sampled colors in color range is not recorded by scripts

  • October 31, 2017
  • 1 reply
  • 4516 views

When i used color range ,the default selected model is highlight,but i used color range with sampled colors model  by scripts in next time ,it stil show the result that is

highlight model.I dont konw why?  please help ,thanks!

cTID = function(s) { return app.charIDToTypeID(s); };

sTID = function(s) { return app.stringIDToTypeID(s); };

    var desc1 = new ActionDescriptor();

    desc1.putInteger(cTID('Fzns'), 80);

    var desc2 = new ActionDescriptor();

    desc2.putDouble(cTID('Lmnc'), 48.58);

    desc2.putDouble(cTID('A   '), -9.14);

    desc2.putDouble(cTID('B   '), -45.14);

    desc1.putObject(cTID('Mnm '), cTID('LbCl'), desc2);

    var desc3 = new ActionDescriptor();

    desc3.putDouble(cTID('Lmnc'), 60.86);

    desc3.putDouble(cTID('A   '), -4.64);

    desc3.putDouble(cTID('B   '), -40.1);

    desc1.putObject(cTID('Mxm '), cTID('LbCl'), desc3);

    desc1.putInteger(sTID("colorModel"), 0);

    executeAction(sTID('colorRange'), desc1, DialogModes.NO);

I try to add"desc1.putEnumerated(cTID('Clrs'), cTID('Clrs'), sTID("sampledColors"));"before in"desc1.putInteger(sTID("colorModel"), 0);",but it has error

This topic has been closed for replies.

1 reply

Legend
November 1, 2017

Could you describe the problem in more detail? How did you determine that "highlights" (as I understand) is applying as you have the DialogModes.NO mode?

The valid ID values for the "colors" enumeration are:

stringIDToTypeID("reds")

stringIDToTypeID("yellows")

stringIDToTypeID("greens")

stringIDToTypeID("cyans")

stringIDToTypeID("blues")

stringIDToTypeID("magenta")

stringIDToTypeID("highlights")

stringIDToTypeID("midtones")

stringIDToTypeID("shadows")

stringIDToTypeID("skinTone")

stringIDToTypeID("outOfGamut")

"sampledColors" is unknown string.at least for PS CS6.

raxby
raxbyAuthor
Inspiring
November 1, 2017

Firsts,the color range default setting is highlights model,like this picture:

when run the code that function is select sampled colors,but the result is still highlights selection not the sampled colors selection

Legend
November 1, 2017

It looks like a bug at least in versions 2015.5-2018. It is not in CS6 It also don`t work in Actions There is another bug in Color Range related to the eyedropper's mode "sapple al layers". Because of this and many other bugs, I do not use either 2015 or 2018 versions.

You can manually call "Color Range" and set "sampled colors" and press Enter. Some time after this, everything will work.