Skip to main content
Inspiring
July 27, 2017
Answered

InDesign and applescript

  • July 27, 2017
  • 2 replies
  • 857 views

I've written an applescript to count the words in a document from a list of documents. Sometimes, a window opens showing there are fonts missing and sometimes it asks if I want to link missing art. I don't care about these windows and would like to close them automatically if they appear. Is there a command to close these? Otherwise, the script doesn't run automatically because of the open windows. I have to close them before it opens the next file.

Or even a command to ignore warning messages.

I appreciate any help I can get.

This topic has been closed for replies.
Correct answer TᴀW

I'm a Javascript man myself, so you'll have to translate this to Applescript, but the command you're looking for is:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

Just make sure to set this back to:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

when the script finishes!

HTH,

Ariel

2 replies

mikeAtJBAuthor
Inspiring
July 27, 2017

Thanks. The command was

set user interaction level of script preferences to never interact

Loic.Aigon
Legend
July 28, 2017

Stick to js as much as you can. When you need to call excel with applescript, use doScript and only for that  

TᴀW
TᴀWCorrect answer
Legend
July 27, 2017

I'm a Javascript man myself, so you'll have to translate this to Applescript, but the command you're looking for is:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

Just make sure to set this back to:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

when the script finishes!

HTH,

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
Steve Werner
Community Expert
Community Expert
July 27, 2017

Moving discussion to InDesign Scripting forum