Illustrator error occurred 1346458189('MRAP') while accessing font color after closing a doc
I have a jsx script that retrieves the font color of every TextFrame object in the active document and does a couple of math ratio checks.
The script runs fine when i run it on an active doc, i have tried running it 5-10 times without any issues repeatedly. It also works when I open a new doc with the old doc still open in a tab, and again it works repeatedly.
However the minute I close an active document, and try to rerun the script on another doc (new or open in a tab), I am running into this error "Illustrator error occurred 1346458189('MRAP')" .
the error is always thrown at this specific line
pageItem.textRange.characterAttributes.fillColor
i have tried the suggested solutions of $.gc() and reducing variables used in loops to no avail. I think this is more a Illustrator bug as it happens in a very specific scenario of closing an active document and is not specific to any doc.
The rest of the code runs fine always.
Any help/suggestions would be appreciated!
All the other parts of the code run fine
