undo() - uncaught exception (-29) error
- October 14, 2025
- 2 replies
- 215 views
Hello Experts,
I'm using the InDesign 20.4.1.
Steps to reproduce the issues:
1. Create a master page containing the multiple text frames.
2. Apply the master page to the interior pages (ensure there are at least 5–10 pages).
3. Save the document, close it, and reopen it to clear the history stack.
Here is my script to undo the overridden textframe by the script:
var Doc = app.activeDocument;
for (z = 0; z < Doc.pages.length; z++) {
page = Doc.pages[z];
var count = 0;
for (j = 0, k = page.appliedMaster.textFrames.length / 2 + 1; j <= k; j++) {
if (page.appliedMaster.textFrames[j].constructor.name == "TextFrame") {
try { page.appliedMaster.textFrames[j].override(page); count++; } catch (e) { continue; }
try { Doc.undo(); } catch (e) { alert(e);}
}
}
}
If there is no undoable data, the process must be routed to catch statement and alert the error message (e).
While running the above script, the attached uncaught exception error occurred.
Note: I couldn't reproduce the same issue in InDesign 19.5.
Thanks in advance.
Regards,
Ashrafali R.
