When you try to retrieve a list of saved presets app.PDFPresetsList
in Illustrator, you may receive the error an Illustrator error occurred: 1128353350 ('FNAC')
.
First, the property must be wrapped in try…catch
so that the script doesn’t break. Second, this script error is only fixed if you open the Edit → Adobe PDF Presets window once in Adobe Illustrator.
The menu can be opened directly from the script for users of Illustrator versions CS6 and higher in the try…catch
block, and for others it displays instructions on how to fix the error themselves.
// move it to start
try {
var pdfPresets = app.PDFPresetsList;
} catch (err) {
var msg = 'Error getting PDF presets\n';
if (parseInt(app.version) >= 16) {
msg += 'The Adobe PDF Preferences window opens to fix the error.\n';
msg += 'Press Ok';
alert(msg);
app.executeMenuCommand('PDF Presets');
} else {
msg += 'To fix the error, choose Edit > Adobe PDF Preferences once';
msg += 'before the script and close';
alert(msg);
}
}
// do something