• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

sampled colors in color range is not recorded by scripts

Explorer ,
Oct 31, 2017 Oct 31, 2017

Copy link to clipboard

Copied

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

TOPICS
Actions and scripting

Views

3.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
People's Champ ,
Oct 31, 2017 Oct 31, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 31, 2017 Oct 31, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Thanks to your reply,i test it in CC2017 and it indeed is a bug.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

As a workaround, save the sample.axt file to your script folder while selecting the "sampled color" mode and click on the "Save" button in the Color Range dialog.


Then insert into the script line after  "var desc1 = new ActionDescriptor ();"

desc1.putPath (charIDToTypeID ("Usng"), new File ("<HERE PLACE PATH TO FILE>" + "/" + "sample.axt" ));

All will work right with DialogModes.NO or DialogModes.ALL

Hope you understand )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

it was a mistake )

you must run such script before main unchanged

var desc0 = new ActionDescriptor();

desc0.putPath (charIDToTypeID ("Usng"), new File ("<HERE PLACE PATH TO FILE>" + "/" + "sample.axt" ));

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

    app.activeDocument.selection.deselect();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Yes,i

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

LATEST

Yes,it can avoid this problem,thanks a lot

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines