Skip to main content
_wckdTall_
Inspiring
August 4, 2026
Question

Illustrator Scripting Memory issues - Catch Pop up errors

  • August 4, 2026
  • 2 replies
  • 23 views

I’m working with a batch script that processes and expands plugin items. The problem, is when I have over 100 open, app.executeMenuCommand("expandStyle") throws a popup message “Can’t Ungroup the objects.” I can’t skip this by placing the menu command in a try catch. No matter how much sleep and redraw I add to the document it won’t catch up either.

I think I’m experiencing an illustrator memory issue, is there a way to capture this error when it fails so that I can at least get notified in a more descriptive way?

    2 replies

    TySprice
    Inspiring
    August 6, 2026

    You could try something like this:

     

    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
     
    var pluginItemCount = app.activeDocument.pluginItems.length;
     
    app.executeMenuCommand("expandStyle");
     
    if(app.activeDocument.pluginItems.length == pluginItemCount) {
     
    alert(String(app.freeMemory));
     
    }else {
     
    //Continue with whatever you need to do with the expanded plugin items
     
    }
     
    app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
    CarlosCanto
    Community Expert
    Community Expert
    August 4, 2026

    it sounds like memory issue,

     

    can you prep a simplified set of files to troubleshoot