3 Replies Latest reply on Sep 25, 2008 9:32 AM by Loic.Aigon

    [JS CS3] Preflight info through scripting

    Andreas Jansson Level 2
      Hi!

      Is it possible to generate the preflight information text from a javascript in InDesign CS3?

      I know it's possible to generate the preflight text (file) by exporting a package (document.packageForPrint), but what about the separate "Preflight" command in the File menu? Is it not available from scripting?

      Thanks,
      AJ
        • 1. Re: [JS CS3] Preflight info through scripting
          Loic.Aigon Adobe Community Professional
          Looking at the ESTK object model library, I can't find any lead for preflight command.
          However, you may have at least 2 ways to explore.
          1. Either use document.packageForPrint
          Document.packageForPrint (to: File , copyingFonts:boolean, copyingLinkedGraphics:boolean, copyingProfiles:boolean, updatingGraphics:boolean, ignorePreflightErrors:boolean, creatingReport:boolean, versionComments:string, forceSave:boolean):boolean

          So Document.packageForPrint (your filepath , false, false, copyingProfiles:false, updatingGraphics:false, ignorePreflightErrors:true, creatingReport:true, versionComments:false, forceSave:false);
          then File(the generated indd filepath).remove();
          So at the end, you only have the report.
          Tricky I know but it can work.

          2.Use the menu.invoke() concept. I am not skilled with that but the Indesign CS3 scripting guide details the procedure.

          Good luck.

          Loic
          • 2. Re: [JS CS3] Preflight info through scripting
            Andreas Jansson Level 2
            Hi!

            I also needed it to work in InDesign server, so I had to go for the solution to generate a package for the preflight to be generated.

            But now a new problem on the subject suddenly arose. I can't find a way to set the name of the printing instructions file. I just assumed that the file name would be the same "instructions.txt" all the time, but running on another computer the file generated was not the same.

            The "preflight/printing instructions file generator" seems to use the file name last entered into the Filename textbox of the Printing instructions dialog window that appears when exporting manually.

            A cheap and dirty workaround would be to return the first .txt file found in the package folder. But can't this file name be set from the object model?

            Please help
            Kind regards, Andreas
            • 3. Re: [JS CS3] Preflight info through scripting
              Loic.Aigon Adobe Community Professional
              i A cheap and dirty workaround would be to return the first .txt file found in the package folder. But can't this file name be set from the object model?
              Hi so far, according to the package command's properties, you can just set to true or false the txt report generation.
              Maybe there is a way but I guess you have to be dirty and rename the txt that you found in the folder.
              Loic