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

Illustrator error occurred: 1346458189 ('PARM')

Guide ,
Apr 08, 2015 Apr 08, 2015

I'm so sick of these errors,

never had an issue before CC

anyone know what is causing these errors?

have been using this script all day and now it bugs out on me.

error2.JPG

full script is below:

var doc = app.activeDocument;

var sel = doc.selection;

var TOmm = 2.83466796875;

Dim(sel);

function Dim(objs) {

    for (var i=objs.length-1;i>=0;i--) { // loop through your collection of objects

        var bounds = objs.visibleBounds; // Get visibal bounds, which are only visable bounds in some cases...

        var b1 = bounds[0] /TOmm;

        var b2 = bounds[1] /TOmm;

        var b3 = bounds[2] /TOmm;

        var b4 = bounds[3] /TOmm;

        var W = Math.abs(b3-b1).toFixed(1);

        var H = Math.abs(b4-b2).toFixed(1);

        var txt = doc.textFrames.add(); // Create the text frame

        txt.contents = "Size:  "+ H + " x " +W + " mm W";  // Adds contents to frame

        txt.position = [objs.left,objs.top - objs.height - 20]; // Positions the frame

  };  

};

Am I missing something in the quality of the Code?

TOPICS
Scripting
9.3K
Translate
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
Adobe
Valorous Hero ,
Apr 08, 2015 Apr 08, 2015

I wonder what kinds of objects are in the selection, and if it could have anything to do with how Illustrator will allow things inside a selection which are not visible? (this happens rarely, but I have seen it)

Translate
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
Guide ,
Apr 08, 2015 Apr 08, 2015

It's not to do with the Selection.

once it starts throwing the error it will do so even with a simple rectangle.

Restart illustrator and its fine again for an indeterminate amount of time.

Some times I will go days without seeing it.

At other times it hits me many times a day.

Translate
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
Valorous Hero ,
Apr 08, 2015 Apr 08, 2015

Hmm, so are you by any chance shuffling between documents?

By the way, do you ensure that all the ones you run are in a closure?

Okay, I know as much about these as the next guy a few years in the game, but I can tell you of some crazy situations where I have encountered this error which would be seemingly unreasonable.

1) variables referring to page items between different documents. Sad, but true.

2) creating outlines from a text frame, and trying to work on compound paths which are produced.  Some come out bad (contained pathItem is Object is Invalid, What??), some don't, so I eventually just made it do try-catch to repeat my process until it worked.

3) Document spot colors in a batch process, where some documents would open up and for no reason at all, some of the spot colors' properties would be invalid, leading to this error.  I made it try-catch close document, open back up, until it worked.

I truly feel you pain, if that helps any.

Translate
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
Guide ,
Apr 08, 2015 Apr 08, 2015

once it errors, it will error on everything.

until illi is restarted.

then it will work on everything.

it just annoying and breaks my workflow.

guessing its some memory leak in the JS engine, but what do I know???

maybe I should flush the variables after using them?

Translate
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
Guide ,
Apr 08, 2015 Apr 08, 2015

when it happened yesterday arvo I only had the 1 doc open...

Translate
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
Valorous Hero ,
Apr 08, 2015 Apr 08, 2015

Well, are all of your scripts wrapped in their own function(){} ?

Hmm if not, it could be something to do with that, but yes, this is blind leading the blind to the max!

However, if we do not bring all this up, it'll never get solved!

Translate
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
Guide ,
Apr 08, 2015 Apr 08, 2015

some are some aren't.

I would be worried if that would cause issues!

Translate
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
Valorous Hero ,
Apr 08, 2015 Apr 08, 2015

Hm, not sure if that's anything to do with this, but I always wrap mine, and even though still get issues I described above, it can't hurt, right?

Translate
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
Community Expert ,
Apr 09, 2015 Apr 09, 2015
Some times I will go days without seeing it.

do you ever shut down Illustrator?

do your scripts run like a million times before restarting illustrator?

all scripts run in a single engine, and all variables are persistent until the engine is destroyed at restart, the engine saturates and crashes.

from the guide

Scripts that create, save, and close many Illustrator files should periodically quit and relaunch

Illustrator. The recommended maximum number of files to process before quitting and relaunching

Illustrator is:

 Windows 500 files

 Mac OS 1000 files

if you get the error in a fresh Illustrator session, then I have no idea.

Translate
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
Guide ,
Apr 09, 2015 Apr 09, 2015

Granted I have an aversion to restarting Illustrator, my computer, or anything, unless I really have to.

My PC goes in to a hybrid Sleep so Startup in the morning maxes out around 10 seconds.

and thanks to Scripts not being persistent in actions.

and nagging little things like "Preserve Black and White" in the "Recolor Artwork" panel also not being persistent on restart.

these combine to make restarting illustrator Painful as well.

with CS6 and previous versions I would go a week, Monday to Friday without restarting My PC, or illustrator.

and at times top a month of up time. no issues.

CC+ and I can just make it through a day if I'm lucky, most often I'm not so lucky.

The script mentioned above has worked with me for many years now, among others. and has not changed.

and although it was throwing an error other scripts would work fine...

I'm sure you are right, it's just annoying that it only started giving me grief since the move to CC.

wish there was a way to: purge all variables / restart the engine / even I had to purge each variable before script exit I may be happy

Translate
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
Community Expert ,
Apr 09, 2015 Apr 09, 2015

give it a try, make all variables = null to see if it helps.

on the other hand, your script could be perfectly fine and CC may be the cause of the error, it wouldn't be the first thing that gets broken with a version "update"

Translate
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
Community Expert ,
Sep 09, 2015 Sep 09, 2015

no resolution at all on this???

Adobe is awfully disappointing since CC came out... and it seems that every "update" things get progressively worse. Not even just with regards to scripting.. In CC 2015 we've had some issues with live text having jacked up anchor points where they don't belong and missing anchor points where they do belong resulting in pie shaped pieces cut out of the stroked appearance of certain letters. I've also seen strokes that have been expanded into compound path fills have anchor points go missing (see screenshot).

When is adobe going to get their act together and actually start responding to the professional community about this stuff?!?!?! frustrating as hell.Screen Shot 2015-09-09 at 3.10.23 PM.jpg

Translate
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
Contributor ,
Dec 19, 2016 Dec 19, 2016
LATEST

CarlosCanto wrote:

from the guide

Scripts that create, save, and close many Illustrator files should periodically quit and relaunch

Illustrator. The recommended maximum number of files to process before quitting and relaunching

Illustrator is:

 Windows 500 files

 Mac OS 1000 files

if you get the error in a fresh Illustrator session, then I have no idea.

Creative Cloud also has autosave every two minutes set by default! To change this go to Edit < Preferences < File Handling & Clipboard

Uncheck the first box.

I turned that off as well, not sure if that made a difference but can't hurt.

Translate
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
Contributor ,
Nov 08, 2016 Nov 08, 2016

I recently "upgraded" to creative cloud so I am going through these issues currently. So far as possible solutions other than having to restart Illustrator I got from reading threads:

  1. Wrap script in a function to get rid of global variables.
  2. Try hitting tab to get rid of panels before executing script.
  3. Make all variables null (but doesn't wrapping the script in a function take care of this?)

Please let me know if I am missing other solutions and I will come back here if I have any success. Thanks everyone!

Translate
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
Valorous Hero ,
Nov 08, 2016 Nov 08, 2016

I used to declare variables in loops and have stopped maybe 2 years ago, not sure if this helped. Now I put them all up into the top and initialize them below.

Before:

for(var i=0; i<x.length; i++){

  var item = x;  

};

After:

var item;

for(var i=0; i<x.length; i++){

  item = x;  

};

Let me know if it helps!

Translate
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
Community Expert ,
Nov 08, 2016 Nov 08, 2016

The only thing i've found that prevents the MRAP/PARM errors as much as possible is to avoid opening/closing files in between running scripts. If you have a script you want to run on several files, open all of them at once (or at least some of them.. i've gotten away with up to 50) and then run the script on each one and then close them when you're done or save/close them with the script.. so you can batch them with something like:

while(app.documents.length > 0)

{

     //do something

     app.activeDocument.close(SaveOptions.SAVECHANGES);

}

It is tedious, but i've identified the opening and closing of files to be the number one cause of these errors.

Good luck, man.

Translate
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
Guru ,
Nov 14, 2016 Nov 14, 2016

Hi

I have found that wrapping each scripts in a named function solves these errors.

This is documented by adobe somewhere (Google it for yourselves)

I used to get the errors a very lot but since doing the wrapping can't remember getting them.

Wrapping them with anonymous functions does not solve the problem.

Missing out vars can mess things up even when wrapped

Silly-V​ do you wrap yours scripts in name or anonymous functions?

Hope this helps someone

Trevor

Translate
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
Valorous Hero ,
Nov 14, 2016 Nov 14, 2016

I always wrap mine in a named function.

#target illustrator

function test(){

    

};

test();

^^^ I have this actually set as a hotstring on all my various workstations.

However, it still does not solve the issue in some situation. Closing the documents in a batch causes it as well as other not-easily-reproducible things such as when using UI's Undo after running a script to undo its effects and then re-running it. Weird stuff like that.

Translate
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
Contributor ,
Nov 29, 2016 Nov 29, 2016

Has anyone messed with not using the "main" engine? I assume the main engine is what Illustrator defaults to if not specified. Would just using the "session" or "transient" engine make a difference when it comes to freeing memory assuming that is the issue? Having trouble finding documentation about how the engines all work. I have wrapped my scripts in functions and I am still getting errors.

Translate
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
Guru ,
Nov 29, 2016 Nov 29, 2016

I don't think you can change the engine on Illustrator by script. (Unlike InDesign)

Maybe you can with c++ (I doubt it) but Ai scripting all goes through BridgeTalk and is AFAIK allocated only one engine.

Translate
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
Community Expert ,
Nov 29, 2016 Nov 29, 2016

I do believe you are correct Trevor. ESTK only gives one option for the engine in illustrator and i've never heard of an override.

Translate
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
Valorous Hero ,
Nov 29, 2016 Nov 29, 2016

I just tried to do #targetengine "session" and it crashes the ESTK!

Translate
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
Guru ,
Nov 29, 2016 Nov 29, 2016

I just tried, it just gave the error message

Cannot execute script in target engine 'session'!

(#57) Engine 'session' does not exists!

Translate
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
Contributor ,
Nov 29, 2016 Nov 29, 2016

Weird, I had an Illustrator cs6 script that used session for a bridgetalk. Now I am getting an error as well.

Looks like transient is working however, did session just change to transient for CC 2017?

#targetengine "transient"

Translate
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