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

Illustrator error occurred: 1346458189 ('MRAP')

New Here ,
Jan 09, 2025 Jan 09, 2025

Copy link to clipboard

Copied

Getting this error when trying to `applyEffect` free distort

var effectString =
          '<LiveEffect name="Adobe FreeDistort"><Dict data="DistortTopLeftX 0 DistortTopLeftY 0 DistortTopRightX 50 DistortTopRightY -20  DistortBottomLeftX -10 DistortBottomLeftY 70 DistortBottomRightX 60 DistortBottomRightY 50"/></LiveEffect>';
        item.applyEffect(effectString);

The problem seems to be caused by the application of the live effect, as the code worked with a simple effect applied, and I'm applying it to a simple PathItem.

 

While searching it seems like the error is a vague one, so any help would be appreciated

TOPICS
Scripting

Views

65

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jan 10, 2025 Jan 10, 2025
  • The name and number of arguments for Free Distort were incorrect
  • I expect the number you intended to use is the scale factor, although a percentage will also work
/**
  * @File Free Distort Sample
  * https://community.adobe.com/t5/illustrator-discussions/illustrator-error-occurred-1346458189-mrap/td-p/15079479
  * @Version 1.0.0
  * @author sttk3.com
*/

(function() {
  if(app.documents.length <= 0) {return ;}
  var doc = app.documents[0] ;
  var sel = doc.selection ;
  if(sel.length <= 0) {r
...

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 10, 2025 Jan 10, 2025

Copy link to clipboard

Copied

  • The name and number of arguments for Free Distort were incorrect
  • I expect the number you intended to use is the scale factor, although a percentage will also work
/**
  * @File Free Distort Sample
  * https://community.adobe.com/t5/illustrator-discussions/illustrator-error-occurred-1346458189-mrap/td-p/15079479
  * @Version 1.0.0
  * @author sttk3.com
*/

(function() {
  if(app.documents.length <= 0) {return ;}
  var doc = app.documents[0] ;
  var sel = doc.selection ;
  if(sel.length <= 0) {return ;}

  var topLeft = [0, 0] ;
  var topRight = [5, -2] ;
  var bottomLeft = [-1, 7] ;
  var bottomRight = [6, 5] ;

  var effectString = '<LiveEffect name="Adobe Free Distort"><Dict data="R src0h 0 R src0v 0 R src1h 1 R src1v 0 R src2h 0 R src2v -1 R src3h 1 R src3v -1 R dst0h ' + topLeft[0] + ' R dst0v ' + topLeft[1] + ' R dst1h ' + topRight[0] + ' R dst1v ' + topRight[1] + ' R dst2h ' + bottomLeft[0] + ' R dst2v ' + bottomLeft[1] + ' R dst3h ' + bottomRight[0] + ' R dst3v ' + bottomRight[1] + ' "/></LiveEffect>' ;
  
  var targetItem = sel[0] ;
  targetItem.applyEffect(effectString) ;
})() ;

Votes

Translate

Translate

Report

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
New Here ,
Jan 10, 2025 Jan 10, 2025

Copy link to clipboard

Copied

LATEST

Thank you 🙏 this worked 

Votes

Translate

Translate

Report

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