6 Replies Latest reply on Mar 29, 2018 1:56 AM by r-bin

    I'm not able to make a selection with script to some of specific colors

    parveenkaloi Level 1

      Hello,

       

      I'm working on some script stuff which selects random colors by input, but there some problem with photoshop to select some colors. Just giving RGB Values through script & it's not making a selection.

      Works with most of random colors, but not all. please please gimme some solution.

       

      Here are RGB values which photoshop not selecting.

      1. R:4, G:99, B:138

      2. R:109, G:225, B:147

       

      Here is the script:

       

      var chercheCouleur = new SolidColor();

      chercheCouleur.rgb.red=109;

      chercheCouleur.rgb.green=225;

      chercheCouleur.rgb.blue=147;

      selectColorRange(chercheCouleur);

      function selectColorRange(scObj)

      {

          var desc = new ActionDescriptor();

          desc.putInteger( charIDToTypeID( "Fzns" ), 0 );

          var cDesc = new ActionDescriptor();

          cDesc.putDouble( charIDToTypeID( "Rd  " ), scObj.rgb.red);

          cDesc.putDouble( charIDToTypeID( "Grn " ), scObj.rgb.green);

          cDesc.putDouble( charIDToTypeID( "Bl  " ), scObj.rgb.blue );

          desc.putObject( charIDToTypeID( "Mnm " ), charIDToTypeID( "RGBC" ), cDesc );

          desc.putObject( charIDToTypeID( "Mxm " ), charIDToTypeID( "RGBC" ), cDesc );

          executeAction( charIDToTypeID( "ClrR" ), desc, DialogModes.NO );

      }

       

      Thanks in advance.