Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Undo group mismatch working with render queue and AME in ExtendScritp

Explorer ,
Nov 16, 2025 Nov 16, 2025

Hi everyone.

I have a couple of functions to send comps to the After Effects render queue and to AME:

 

const sendToAME = (options: KT_RenderOptions) => {
    const RQItems: RenderQueueItem[] = addToQueue(options);
    if (app.project.renderQueue.canQueueInAME) {
        app.project.renderQueue.queueInAME(false);
    }
    for (let i = 0; i < RQItems.length; i++) {
        const rqItem = RQItems[i];
        rqItem.remove();
    }
    return RQItems;
};

const addToQueue = (options: KT_RenderOptions): RenderQueueItem[] => {
    const RQItems: RenderQueueItem[] = [];
    const compsArray = options.comps instanceof Array ? (options.comps as CompItem[]) : [options.comps as CompItem];
    const templateName = options.template || this.DEFAULTE_TEMPLATE;
    for (let i = 0; i < compsArray.length; i++) {
        const comp = compsArray[i];
        if (!is.comp(comp)) continue;
        const rqItem = app.project.renderQueue.items.add(comp);
        const om = rqItem.outputModule(1);
        om.applyTemplate(templateName);
        let outputFilePath = IO.path.join(options.path, `${comp.name}`);
        outputFilePath = IO.path.sanitize(outputFilePath);
        om.file = new File(outputFilePath);
        RQItems.push(rqItem);
    }
    return RQItems;
};

 

At first, it worked perfectly, but suddenly I started getting the familiar "Undo group mismatch, will attempt to fix" error. 

 

I've been looking for information and found that After Effects creates its own internal undo groups ("undoables") when working with the render queue tha may cause errors. 

 

When I run the vscode debugger with breakpoints step by step, it never fails so I've tried wrapping the functions with empty undo groups and adding only `app.endUndoGroup` at the end of each iteration, but the error persists.

 

Does anyone with experience know how to fix this correctly?

TOPICS
Scripting
69
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 18, 2025 Nov 18, 2025
LATEST

I've encountered this error message on a few occasions,  although it appears very rarely and randomly.  so I'm unable to actually replicate.  (just sending comps to the Render Queue).   I hit ok after the message and all seems well, so I just move along.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines