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

Ignore warnings on open()

Guest
Oct 16, 2009 Oct 16, 2009

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

TOPICS
Scripting
1.6K
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 , Oct 16, 2009 Oct 16, 2009

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.

Translate
Community Expert ,
Oct 16, 2009 Oct 16, 2009

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.

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
Guest
Oct 16, 2009 Oct 16, 2009

Yes, that's it!

Thanks a lot 😉

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
Community Expert ,
Oct 16, 2009 Oct 16, 2009

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.

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
Advocate ,
Oct 16, 2009 Oct 16, 2009
LATEST
"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.

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