Hi Uwe, Below the script. The script creates PDF-files for all Indesign files in a specific folder. To test the issue, you can use any document which contains missing Adobe Type fonts. Before testing, make sure auto font activation in Indesign 2020 is active. The PDF-files are generated with the wrong fonts ... //**************************************************
//
// 2008-2020 © Written by Tim Melis
//
// This script will create PDF-files for
// all Indesign files in specific folder
//
//**************************************************
// Displaying window to choose source folder
var mySourceFolder = Folder.selectDialog("Select the folder containing the Indesign files");
// Displaying window to choose destination folder
var myDestinationFolder = Folder.selectDialog("Select the PDF target location!");
// Ask for PDF preset
var myPreset = askForPreset();
// If a source folder is selected
if (mySourceFolder != null) {
// If a destination folder is selected{
if (myDestinationFolder != null) {
// Retreive list of Indesign files
myFiles = mySourceFolder.getFiles("*.indd");
// For every file in the folder
for (var j = 0; myFiles.length > j; j++) {
// process single file
processFile(myFiles[j], myDestinationFolder, myPreset);
}
}
}
alert("Done ...");
// **************************************************
// Additional functions
// **************************************************
// --------------------------------------------------
// Ask for PDF preset
// --------------------------------------------------
function askForPreset() {
var myList = getPDFpresetList();
myDlg = new Window('dialog', 'Select a PDF preset!');
myDlg.orientation = 'column';
myDlg.alignment = 'right';
myDlg.DDgroup = myDlg.add('group');
myDlg.DDgroup.orientation = 'row';
myDlg.DDgroup.add('statictext', undefined, "Export PDF presets:");
myDlg.DDgroup.DD = myDlg.DDgroup.add('dropdownlist', undefined, undefined, { items: myList })
myDlg.DDgroup.DD.selection = 0;
myDlg.closeBtn = myDlg.add('button', undefined, 'OK');
myDlg.closeBtn.onClick = function () {
this.parent.close();
}
result = myDlg.show();
var myName = myDlg.DDgroup.DD.selection.text;
var myPreset = getPresetbyName(myName);
return myPreset;
}
// --------------------------------------------------
// Get list of all presets
// --------------------------------------------------
function getPDFpresetList() {
var myList = new Array();
for (var i = 0; i < app.pdfExportPresets.count(); i++) {
myList.push(app.pdfExportPresets.item(i).name);
}
return myList;
}
// --------------------------------------------------
// Get preset by name
// --------------------------------------------------
function getPresetbyName(_myPresetName) {
for (var i = 0; i < app.pdfExportPresets.count(); i++) {
myPreset = app.pdfExportPresets.item(i);
if (myPreset.name == _myPresetName) {
var myFinalPreset = myPreset;
break;
}
}
return myFinalPreset;
}
// --------------------------------------------------
// Get preset by name
// --------------------------------------------------
function processFile(_myFile, _destinationFolder, _myPreset) {
// opening the file
app.open(myFiles[j]);
// FONT ISSSUE ! MISSING FONTS
// Retreive filename
var fileName = app.activeDocument.name.replace(".indd", "");
// Get PDF folder path
var pdfFilePath = _destinationFolder + "/" + fileName + ".pdf";
// Export to PDF
app.activeDocument.exportFile(ExportFormat.pdfType, File(pdfFilePath), false, _myPreset);
// Closing the file
app.activeDocument.close();
}
... View more