Skip to main content
Inspiring
August 6, 2026
Question

Showing progress bar while suppressing alerts in script

  • August 6, 2026
  • 2 replies
  • 14 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);
}

 

2 replies

CarlosCanto
Community Expert
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;
}