0 Replies Latest reply on May 17, 2011 4:26 PM by dsackett

    [JS CS4] Missing font modal dialog boxes

    dsackett Level 1


      I'm scripting a newsletter production workflow where writers send in a bunch of  mixed Word and InCopy  files & the script places them into a template. The aim of this script is to amalgamate various articles into one long story. So I've set up a template, turned on smart text reflow, but the loop to place files hangs if any of the files contain missing fonts. I picked up a clue from an earlier post about suppressing error messages with:


      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;


        The command does indeed hide the UI, but I presume it's not really overriding the error, because the subsequent files in the placement loop after a file with missing fonts fails to import. I can't  now  recall how I saw a message about a modal dialog not being dismissed. Is there another technique for placing files that can use import presets and also can manage the potential for missing fonts?


      Here's the snippet of the file placing loop if that'll help:

           // loop though from end to top, since default place is at the top of the designated frame
           for (var f = collageFiles.length-1; f > 0; f--) {
                myFrame.place(File(myCollageSrc +"/"+collageFiles[f], false));
                // insert spacer paragraph & format it  otherwise previously inserted headline'll go to body text 
                myFrame.paragraphs[0].insertionPoints[0].contents = "\r";
                myFrame.paragraphs[0].appliedParagraphStyle = "Body Text";

      TIA for your deeper knowledge.