Skip to main content
Participant
March 24, 2025
Question

Set "Output Intent Profile Name"when saving via script

  • March 24, 2025
  • 0 replies
  • 87 views

When saving via script, can I set the Output Intent Profile Name?  I've been trying without any luck.  If I set the pDFPreset, it uses the default Output Intent Profile Name.  

 

This is my script:

function savePrintFile() {
    if (app.documents.length === 0) {
        alert("No document open.");
        return;
    }

    var doc = app.activeDocument;
    
    // Open save dialog to name file and select location
    var currentFile = new File(doc.fullName)
    var saveFile = currentFile.saveDlg();
    if (saveFile) {
        // Save as PDF/X4
        var saveOptions = new PDFSaveOptions();         

        saveOptions.pDFPreset = '[PDF/X-4:2008]';
        saveOptions.preserveEditability = false;
        saveOptions.outputCondition = 'GRACoL2006_Coated1v2.icc';
        saveOptions.outputConditionID = 'Custom';
        saveOptions.outputIntentProfile = 'GRACoL2006_Coated1v2.icc';

        doc.saveAs(saveFile, saveOptions);

        return saveFile;
    }
}