Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Export to PDF with modal dialogsHi, Iam

New Here ,
Feb 26, 2010 Feb 26, 2010

Hi,

I am trying to export Indesign document into PDF using Javascript. When the document has a missing font or link, a warning pops up and the export command fails saying there is a modal dialog that is open. How do I disable all the warnings or close all the warning dialogs before executing my export command?

thanks for your help.

TOPICS
Scripting
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 26, 2010 Feb 26, 2010

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

This will completely and utterly hide all dialogs. Be kind to your users (and to yourself!) and disable it just before a command that may pop up unwanted dialogs; then, right after that command, enable them again! Or else you will never see a Javascript error pop up, or, for that matter, any other ID dialog. It does what it says on the label!

Translate
Community Expert ,
Feb 26, 2010 Feb 26, 2010

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

This will completely and utterly hide all dialogs. Be kind to your users (and to yourself!) and disable it just before a command that may pop up unwanted dialogs; then, right after that command, enable them again! Or else you will never see a Javascript error pop up, or, for that matter, any other ID dialog. It does what it says on the label!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 17, 2012 Feb 17, 2012

Hi Rums,

I have an Applescript to do a PDF export with warnings for missing/modified links or fonts that works nicely from the script panel in InDesign.

But I wanted to make it run form a panel. Unfortunatly teh Adobe Configurator only works with javascript.

I have no expertise at all with javascript.

Could I make use of your script?

Would be very grateful.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 29, 2012 Feb 29, 2012
LATEST

sure kris..... here is the script that I used.

var runScript = function (inputFilePath, pdfFilePath)

{

 

          try {

                    // suppress warnings, alerts

                    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

 

                    // open input file

                    var inFile = new File (inputFilePath);

                    var myDocument = app.open (inFile);

 

                    // export the file to pdf

                    app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;

                    var pdfFile = new File(pdfFilePath);

                    myDocument.exportFile(ExportFormat.pdfType, pdfFile, false);

 

 

                         

                    // Close the document in InDesign

                    app.activeDocument.close(SaveOptions.no);

 

                    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

 

          } catch (e) {

                    alert ("There was a problem exporting file ("+e+")");

          }

 

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2012 Feb 22, 2012

var myFolder = Folder.selectDialog("Select an in folder.");

var files = myFolder.getFiles ("*.indd");

var outFolder = Folder.selectDialog("Select an out folder.");

app.scriptPreferences.userInteractionLevel=UserInteractionLevels.NEVER_INTERACT;

for(i = 0, l = files.length; i <l; i++)

{

    myFile = app.open(files, true)    

}

myFile.exportFile(ExportFormat.PDF_TYPE, File(outFolder + "/" + myFile.name.replace(/\.indd$/,"") +".pdf"), false);

myFile.close(SaveOptions.NO);

}

alert("PDFs have been generated.")

app.scriptPreferences.userInteractionLevel=UserInteractionLevels.interactWithAll

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines