37 Replies Latest reply on Dec 19, 2016 6:35 AM by djbgraphicdesign

    Illustrator error occurred: 1346458189 ('PARM')

    Qwertyfly... Level 4

      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[i].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[i].left,objs[i].top - objs[i].height - 20]; // Positions the frame
        };   
      };
      

       

      Am I missing something in the quality of the Code?

        • 1. Re: Illustrator error occurred: 1346458189 ('PARM')
          Silly-V Adobe Community Professional

          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)

          • 2. Re: Illustrator error occurred: 1346458189 ('PARM')
            Qwertyfly... Level 4

            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.

            • 3. Re: Illustrator error occurred: 1346458189 ('PARM')
              Silly-V Adobe Community Professional

              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.

              • 4. Re: Illustrator error occurred: 1346458189 ('PARM')
                Qwertyfly... Level 4

                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?

                • 5. Re: Illustrator error occurred: 1346458189 ('PARM')
                  Qwertyfly... Level 4

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

                  • 6. Re: Illustrator error occurred: 1346458189 ('PARM')
                    Silly-V Adobe Community Professional

                    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!

                    • 7. Re: Illustrator error occurred: 1346458189 ('PARM')
                      Qwertyfly... Level 4

                      some are some aren't.

                      I would be worried if that would cause issues!

                      • 8. Re: Illustrator error occurred: 1346458189 ('PARM')
                        Silly-V Adobe Community Professional

                        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?

                        • 9. Re: Illustrator error occurred: 1346458189 ('PARM')
                          CarlosCanto Adobe Community Professional & MVP
                          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.

                          • 10. Re: Illustrator error occurred: 1346458189 ('PARM')
                            Qwertyfly... Level 4

                            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

                            • 11. Re: Illustrator error occurred: 1346458189 ('PARM')
                              CarlosCanto Adobe Community Professional & MVP

                              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"

                              • 12. Re: Illustrator error occurred: 1346458189 ('PARM')
                                williamadowling Level 4

                                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

                                • 13. Re: Illustrator error occurred: 1346458189 ('PARM')
                                  djbgraphicdesign Level 1

                                  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!

                                  • 14. Re: Illustrator error occurred: 1346458189 ('PARM')
                                    Silly-V Adobe Community Professional

                                    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!

                                    • 15. Re: Illustrator error occurred: 1346458189 ('PARM')
                                      williamadowling Level 4

                                      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.

                                      • 16. Re: Illustrator error occurred: 1346458189 ('PARM')
                                        Trevorׅ Adobe Community Professional

                                        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

                                        • 17. Re: Illustrator error occurred: 1346458189 ('PARM')
                                          Silly-V Adobe Community Professional

                                          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.

                                          • 18. Re: Illustrator error occurred: 1346458189 ('PARM')
                                            djbgraphicdesign Level 1

                                            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.

                                            • 19. Re: Illustrator error occurred: 1346458189 ('PARM')
                                              Trevorׅ Adobe Community Professional

                                              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.

                                              • 20. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                williamadowling Level 4

                                                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.

                                                • 21. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                  Silly-V Adobe Community Professional

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

                                                  • 22. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                    Trevorׅ Adobe Community Professional

                                                    I just tried, it just gave the error message

                                                    Cannot execute script in target engine 'session'!

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

                                                    • 23. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                      djbgraphicdesign Level 1

                                                      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"

                                                      • 24. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                        Silly-V Adobe Community Professional

                                                        Oh you're right!

                                                         

                                                        I restarted my AI, and now I don't get the non-responsive ESTK or crash, I just get either working transient script or error message about no engine.

                                                         

                                                        What believe I know about transient is that it is the engine used by the File > Scripts menu, because my startup scripts would activate every time one of those menu scripts was ran, and I had to use this to not have it do that:

                                                        if($.engineName != 'transient' && $.engineName != ''){

                                                         

                                                        Also, I am not too clear on my memory, but there was also a no-name engine whose name was somehow an empty string, which also had to be accounted for in the above line.

                                                        • 25. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                          Trevorׅ Adobe Community Professional

                                                          Drat I just got Error Description: an Illustrator error occurred: 1346458189 ('MRAP')

                                                          The function was not properly wrapped and too many things were being zapped at Illustrator at a time.

                                                          newSpot.colorType = ColorModel.SPOT; caused the error.

                                                          The extension creates Ai (PDF) files on dropping  xml files in a folder.

                                                          The error occurred on for only one of several documents that were already in the watch folder when Illustrator started.

                                                          On re-saving the XML the PDF was created without error.

                                                          I think in my case I should be able to get out of the problem.

                                                          Time for bed!

                                                          • 26. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                            Trevorׅ Adobe Community Professional

                                                            I just dumped 9 XMLs simultaneously in the watch folder and Ai produced the documents in a second with know problem.

                                                            The initial problem might be related to the extension opening a document on Illustrator opening.

                                                            • 27. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                              Stephen_A_Marsh Adobe Community Professional

                                                              This comment intrigues me: Watched folder … multi XML input … Ai automatically creating files in another directory = Joy!

                                                               

                                                              Please tell me more…

                                                              • 28. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                Trevorׅ Adobe Community Professional

                                                                I think I sorted out the MRAM problem, I think it was because I hadn't explicitly passed which document the add spot function was supposed to add the spot to so it defaulted to the active document, but as too much was happening Ai creating and opening, closing and send mails to many documents simultaneously it wasn't locating the activeDocument so I explicitly passed the document to the function and don't get the error any more.

                                                                 

                                                                The error started to occur when I got the extension to mail the documents, maybe that confuses the active document

                                                                 

                                                                Here's a screenshot

                                                                 

                                                                2016-11-30_18-03-44.png

                                                                 

                                                                Here's a video, unfortunately, I couldn't upload the video to Vimeo for some reason so if you want to see it your have to download the mp4.

                                                                The video is less than a minute so you won't be bored for too long.

                                                                Dropbox - XML_To_Ai.mp4

                                                                The workflow of the extension is.

                                                                1) On Ai execution load default document. This is because if there's no document open and one is created it takes a comparatively long time to create and close the new documents.

                                                                2) Looks at a selected folder to see if it's got any XMLs in it and keeps looking (Chodikar)

                                                                3) Checks the XMLs valid, if not send the XML as an attachment to the supervisor with and angry ecomotion. If valid calls the appropriate function in the jsx script

                                                                4) The jsx script creates the document using a very sophisticated and quick api I wrote for drawing shapes on Ai. The different XMLs will produce completely different types of document of the given dimensions and specification.

                                                                5) These files are saved in a folder for further processing, but I'm not involved with that bit.

                                                                6) If there's a problem it will be logged and mailed to the supervisor.

                                                                6.5) There's quite a bit of logging.

                                                                7) I the email config file has be set to true for emailing the files then they will be mailed like in the screenshot and video.

                                                                 

                                                                I had one method that could spit out a really lot of documents in a second but I was nervous that it could cause problems even though I didn't have any evidence for this so I went for a slower method but it's still very quick. You can see on the video how long it take from the XML save until the PDF shows up on finder. The PDFs really done quite a bit quicker but it takes time for finder to find it.

                                                                 

                                                                The idea is to have some bloke who knows nothing about Illustrator create documents that would take hours to do manually by an Illustrator professional and do it in a fraction of a second.

                                                                 

                                                                That's what scriptings about!  The extension in not in the $50 to $100 league

                                                                Done using quite a lot of nodesjs stuff.

                                                                 

                                                                Regards

                                                                 

                                                                Trevor

                                                                • 29. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                  Trevorׅ Adobe Community Professional

                                                                  Trevorׅ wrote:

                                                                   

                                                                  I just dumped 9 XMLs simultaneously in the watch folder and Ai produced the documents in a second with know problem.

                                                                  The initial problem might be related to the extension opening a document on Illustrator opening.

                                                                  meant to write "no problem"

                                                                  Over tired

                                                                  • 30. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                    Silly-V Adobe Community Professional

                                                                    A real advanced power script!

                                                                    • 32. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                      Silly-V Adobe Community Professional

                                                                      How nice, that was for the same one! I'd love to be of help to you for any project that's too big for one person, potentially!

                                                                      • 33. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                        djbgraphicdesign Level 1

                                                                        Well this problem is getting weird, more people upgraded and some people are not getting the errors at all, while others are getting them frequently. They are using the same scripts, so maybe there is nothing wrong with my scripts and it is some other issue going on.

                                                                         

                                                                        Trevor, that is awesome thanks for sharing. Seeing stuff like that is great motivation to keep learning so one day I can figure out how the hell you did that and really streamline some things haha. I'm currently taking a CS class online and learning a lot about C and command line programs.

                                                                        • 34. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                          djbgraphicdesign Level 1

                                                                          Just figured out the culprit has 2gb's less of ram on his computer. Would that possibly be causing the issue?

                                                                          • 35. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                            Stephen_A_Marsh Adobe Community Professional

                                                                            Thank you for Sharing Trevor, it is nice to know what is possible!

                                                                            • 36. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                              djbgraphicdesign Level 1

                                                                              OK, I am pretty sure I found out what was causing the issue. A lot of my coworkers are signed into online libraries. I tried signing into one and I started getting the error more frequently. I then signed out of the library and the errors went away for the most part. I got one of my coworkers to leave his online libraries and he stopped getting the errors.

                                                                               

                                                                              I hope this helps someone! Be sure to actually leave the libraries, if you just exit out of your library panel you will still be signed in.

                                                                              • 37. Re: Illustrator error occurred: 1346458189 ('PARM')
                                                                                djbgraphicdesign Level 1

                                                                                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.