Adobe developers are adding new features and slowly fixing old bugs. Or updates break a working tool. This happened with creating textFrames objects via JS, which crashed Illustrator.
I found a bug when I was testing the NumeratesPoints script. With the preview active, the script creates textFrames, and after the user enters a new number, it runs undo()
and creates new numbers.
With the release of CC 2020 v.24.3, Illustrator started crashing with previews enabled. I found that the problem is not with the entire preview function, but only with the part that recreates the text.
Bug demo
A simple test on a short script confirmed the suspicions. Create any text frame, go back to the history one step and create the text again — Illustrator v.24.3 (Mac OS) crashes.
addText();
redraw();
alert('Done');
undo();
addText();
function addText() {
var str = activeDocument.textFrames.add();
str.textRange.characterAttributes.size = 16;
str.contents = 'Example';
str.top = 0;
str.left = 0;
}
Conclusion
After CC 2020 v.24.3, Adobe released Illustrator CC 2021, where this problem disappeared. And I added a patch in the NumeratesPoints script — disabling preview function for users of version 24.3.
var AI_VER = app.version.slice(0, 4);
if (AI_VER == '24.3') isPreview.enabled = false;