How to script a document mode change?
For a project I'm working on I'm writing a Javascript code that does a bunch of things including resizing a document. I need to change it into index before I resize it so the edges don't get blurry and then change it back to RGB but so far nothing is working. Here is what I've been trying:
var srcDoc = app.activeDocument;
var pixelLoc = [1,1];
var colorSamplerRef = srcDoc.colorSamplers.add(pixelLoc);
app.foregroundColor = colorSamplerRef.color;
colorSamplerRef.remove()
srcDoc.changeMode(ChangeMode.INDEXEDCOLOR)
docRes = srcDoc.resolution
if (docRes/10 >= 10){
srcDoc.resizeImage(undefined, undefined, docRes/10, undefined, undefined);
}
else{}
srcDoc.changeMode(ChangeMode.RGB)The error right now is they want conversion options but I'm lost. Is there a way to say default?