Skip to main content
Known Participant
October 9, 2024
Question

Illustrator error occurred 1346458189('MRAP') this issue occurring in illustrator using extendscript

  • October 9, 2024
  • 1 reply
  • 1416 views

Hi Folks

While get the characterAttributes.textFont.style using extendscript i'm getting this error (Illustrator error occurred 1346458189 ('MRAP')).

 

Note:

1) For single file processing it wont be occurred but after processing one file then second file processing then only this error happened.

2) While run the script manually its not throwing error. But run this from the CEP panel only get this error.

 

Sample code:

var doc = app.activeDocument;
var textFontStyle = []
for (var i = 0; i < doc.textFrames.length; i++) {
var txtFrame = doc.textFrames[i];
var textRange = txtFrame.story.textRange;
var textCharactersAll = textRange.characters;
var textProperties = [];
var checkChar = 0;

// Loop through characters in the text line
for (var k = 0; k < textCharactersAll.length; k++) {
var textCharacter = textCharactersAll[k];
var fontStyle = textCharacter.characterAttributes.textFont.style;
textFontStyle.push(fontStyle)
}
}
alert(textFontStyle)

 

 

Please advice on this

Thanks in advance

This topic has been closed for replies.

1 reply

Legend
October 10, 2024

That error usually occurs in the following situations.

 

  1. Too many property queries to Illustrator
  2. A negative value is specified for the artboard size

 

In this case, it corresponds to 1. The basic workaround is to reduce the number of program steps: for example, extract the font information from the XMP metadata of the document, instead of looping for each character, and so on.

 

There are rumors that setting variables to null frequently or executing $.gc() can improve the situation.

Known Participant
October 10, 2024

Thanks @sttk3 

In my situation unable fetch font info from xmp. I need all the textframe contents each and every character style like fontstyle, underline, fontbaseline etc., in this situation how to resolve this issue. If u can give an idea it will be helpful for me.

Legend
October 10, 2024

It is certainly difficult to avoid under the conditions you have provided. Candidates for a workaround are as follows.

 

  • The method described above, such as frequently setting variables to null in each loop, or executing $.gc(), etc.
  • Running the program from outside Illustrator using AppleScript or VBS, and restarting it externally when Illustrator makes an error