Skip to main content
Inspiring
August 6, 2026
Answered

Showing progress bar while suppressing alerts in script

  • August 6, 2026
  • 4 replies
  • 50 views

I have a script to analyze hundreds of documents to validate their layer names and then log the results to a .csv file. I had code to suppress alerts (especially missing font alerts), and that worked, except it also unexpectedly suppressed updates to the progress bar, which adds frustration and uncertainty to the UX.

Is there any way to both suppress the alerts and get progress bar updates?

Here is the code to suppress the alerts:

var oldInteraction = app.userInteractionLevel;

if (suppressIllustratorAlerts)
{
app.userInteractionLevel =
UserInteractionLevel.DONTDISPLAYALERTS;
}

Here is the code the displays the progress bar:

function updateProgress(win, statusText, countText, progressBar, fileName, current, total)
{
statusText.text =
"Processing: " +
fileName;

countText.text =
current +
" of " +
total;

progressBar.value = current;

win.layout.layout(true);
win.update();

// Small pause gives Illustrator a chance to repaint the palette.
$.sleep(10);
}

 

Correct answer CarlosCanto

untested idea, can you …?

  • suppress alerts
  • open doc
  • restore alerts
  • do your thing
  • loop

4 replies

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
August 6, 2026

untested idea, can you …?

  • suppress alerts
  • open doc
  • restore alerts
  • do your thing
  • loop
Inspiring
August 6, 2026

Good idea. It worked to simply surround the file open step with code to suppress alerts, and disable it outside of that action.

 

		var previousLevel =
app.userInteractionLevel;

if (suppressIllustratorAlerts)
{
app.userInteractionLevel =
UserInteractionLevel.DONTDISPLAYALERTS;
}

doc = app.open(files[i]);

if (suppressIllustratorAlerts)
{
app.userInteractionLevel =
previousLevel;
}

 

Inspiring
August 14, 2026

And by “disable it outside of that action,” I meant disable the disabling of it. Which I realize is a confusing double negative. It would have been better to say “suppress alerts for the file open command, and then re-enable them for the remainder of the process.”