4 Replies Latest reply on Oct 16, 2009 4:28 AM by sstanleyau

    Ignore warnings on open()

    Larsito

      Hi,

       

      I am writing a script that automates idml export. Basically it iterates over a directory, opens all indd files one after another and exports it as an idml file. Often I get warning because fonts or links are missing. I would like to supress these warnings and continue with the script anyway, without have to aknowledge (click) the messages manually.

       

      Someone knows how this can be configured?

       

      Thanks a lot!

       

      Lars

        • 1. Re: Ignore warnings on open()
          [Jongware] Most Valuable Participant

          Set the userInteractionLevel to NEVER_INTERACT:

           

          app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

           

          Don't forget to restore it to INTERACT_WITH_ALL, or you will not get any InDesign dialogs anymore. Any at all.

          • 2. Re: Ignore warnings on open()
            Larsito Level 1

            Yes, that's it!

             

            Thanks a lot ;-)

            • 3. Re: Ignore warnings on open()
              [Jongware] Most Valuable Participant

              Be careful: a very frequent complaint is 'Indesign still works, but it doesn't display dialogs any more' (usually followed by capital 'help' and lots of exclamation signs).

              This happens when a you switch off user interaction and forget to switch it back on at the end of the script -- an unforgiveable error! -- or give the user a chance to manually interrupt the script (in which case it is, eh, their own fault).

               

              Besides, you also won't see any error message pop up.

               

              "Best practice" is considered to switch off the interaction right before the command that you really want to suppress, and switch it back on right after that. Put the command itself inside 'try ..catch', so it will work even if this causes an error.

              • 4. Re: Ignore warnings on open()
                sstanleyau Level 4
                "Best practice" is considered to switch off the interaction right before the command that you really want to suppress, and switch it back on right after that.

                And switch it on before trying to show a dialog, for when the other guy forgot to switch it back on.