How can i open the "Convert to Indexed Color" dialog with custom presets?
Hi,
I need to automatically open the "Convert to Indexed Colors" dialog in Photoshop. Before and after that i have some scripts running so its not possible to open the dialog manually. Also i want to set some custom presets (like number of colors etc.).
Found something similar to what i want for the Color Range selection (opens the dialog with the presets you put in):
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 achieve the same for the indexed color conversion dialog? Apart from doing a lot of guessing regarding the stringIDs.
Is there some kind of "lookup table" for char and string IDs?
Thank you guys in advance! This forum has been a great help many times.
