Question
Showing progress bar while suppressing alerts in script
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);
}
