PDFOpenOptions issue with open(file, options)
Hi guys,
I have a script to open JPGs and now I need to adapt it to open PDFs.
I'm getting a "wrong type of enumerated value" error exactly because of the way I'm working the PDFOpenOptions (line "open(fileList, pdfOpenOptions);").
I found quite a few scripts that define pdf open options just like I did, but in all of them the root path was hard coded (I need it dynamic).
So, where am I going wrong? Too much time on it, can't see errors anymore... (mac, cs4)
#target photoshop
app.preferences.rulerUnits = Units.PIXELS;
app.displayDialogs = DialogModes.NO;
app.backgroundColor.rgb.red = 255;
app.backgroundColor.rgb.green = 255;
app.backgroundColor.rgb.blue = 255;
var pdfOpenOptions = new PDFOpenOptions();
pdfOpenOptions.antiAlias = true;
pdfOpenOptions.mode = DocumentMode.RGB;
pdfOpenOptions.bitsPerChannel = BitsPerChannelType.EIGHT;
pdfOpenOptions.resolution = 72;
pdfOpenOptions.supressWarnings = true;
pdfOpenOptions.cropPage = CropToType.TRIMBOX;
var fileList = File.openDialog("Select files to batch",true);
if (fileList != null) {
for (var i in fileList) {
if (fileList instanceof File && fileList.hidden == false) {
open(fileList, pdfOpenOptions);
}
}
alert("Done");
}
else {
alert("No files selected");
}
Thanks in advance!
