How can I open the "Convert to indexed colors" dialog box with custom presets?

Hello

I need to automatically open the "Convert to indexed colors" dialog box in Photoshop. Before and after that I have a few scripts that are running, so it is not possible to open the dialog manually. Also, I want to put some custom presets (like the number of colors, etc.).

Find something similar to what I want for the color range selection (opens the dialog with the presets you put in that):

function colorrange(enabled, withDialog, fuzziness) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putInteger(app.charIDToTypeID('Fzns'),fuzziness);
    var desc2 = new ActionDescriptor();
    desc2.putDouble(app.charIDToTypeID('Lmnc'), 31.22);
    desc2.putDouble(app.stringIDToTypeID("a"), 0.86);
    desc2.putDouble(app.stringIDToTypeID("b"), 0.31);
    desc1.putObject(app.charIDToTypeID('Mnm '), app.charIDToTypeID('LbCl'), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Lmnc'), 95.34);
    desc3.putDouble(app.stringIDToTypeID("a"), 54.59);
    desc3.putDouble(app.stringIDToTypeID("b"), 49.85);
    desc1.putObject(app.charIDToTypeID('Mxm '), app.charIDToTypeID('LbCl'), desc3);
    desc1.putInteger(app.stringIDToTypeID("colorModel"), 0);
    var desc4 = new ActionDescriptor();
    var desc4 = executeAction(app.stringIDToTypeID('colorRange'), desc1, dialogMode);
  };

How can I get the same thing for the indexed color conversion dialog box? Apart from doing a lot of guessing about the stringIDs.

Is there some kind of "table of choice" for char and string ID?

Guys thank you very much in advance! This forum has been a great help on several occasions.

OK never mind I got it, stupid me.

He has recorded with Listener Script and changed the "DialogMode" parameter of the function of executeAction "DialogModes.No" at "DialogModes.All".

var idCnvM = charIDToTypeID( "CnvM" );
            var desc249 = new ActionDescriptor();
            var idT = charIDToTypeID( "T  " );
                var desc250 = new ActionDescriptor();
                var idPlt = charIDToTypeID( "Plt " );
                var idClrP = charIDToTypeID( "ClrP" );
                var idSele = charIDToTypeID( "Sele" );
                desc250.putEnumerated( idPlt, idClrP, idSele );
                var idClrs = charIDToTypeID( "Clrs" );
                desc250.putInteger( idClrs, 4 );
                var idFrcC = charIDToTypeID( "FrcC" );
                var idFrcC = charIDToTypeID( "FrcC" );
                var idNone = charIDToTypeID( "None" );
                desc250.putEnumerated( idFrcC, idFrcC, idNone );
                var idTrns = charIDToTypeID( "Trns" );
                desc250.putBoolean( idTrns, false );
                var idDthr = charIDToTypeID( "Dthr" );
                var idDthr = charIDToTypeID( "Dthr" );
                var idDfsn = charIDToTypeID( "Dfsn" );
                desc250.putEnumerated( idDthr, idDthr, idDfsn );
                var idDthA = charIDToTypeID( "DthA" );
                desc250.putInteger( idDthA, 75 );
            var idIndC = charIDToTypeID( "IndC" );
            desc249.putObject( idT, idIndC, desc250 );
        executeAction( idCnvM, desc249, DialogModes.ALL ); //Change from NO to ALL

Tags: Photoshop

Similar Questions

Maybe you are looking for

  • SIT and SBRIO-9631

    Hi all I am trying to export several networks of neurons in simulink model to the SBRIO-9631. I use the simulation interface toolkit to achieve and I started with the model of the sine wave, downloaded from http://www.ni.com/white-paper/11654/en. Aft

  • The Surface RT will be all support stiletto?

    I ordered a Surface just before RT and wondered what stylus support, if any, it will have? I don't know the Surface with Windows 8 pro will come with the stylus and use technology to block palm, but this same stylus works on the RT version, or will b

  • I recvd error 'program compatibility problem' for my logitech g27 wheel.

    Logitech G27 Racing Wheel game controller I recvd 'compatibility problem program' error for my logitech g27 steering wheel wheel.it has been running for 1 1/2 years.

  • While in a while loop loop will not stop running

    HY, I have a while loop and hand inside the other 2 If. The attached VI supposed to work like this: 1. define the input data 2 - Press START to "animate" the data in the chart 3 - Press STOP to stop the animation and the hand while the loop must trav

  • How can I get chewck fate for Windows Mail?

    Had to start all over again because of problems with Pak 1 Download Vista and now Windows Mail does not check the spelling.