3 Replies Latest reply on Oct 24, 2017 2:10 AM by karth80472045

    ID=-108 error

    karth80472045 Level 1

      Hello all ,

       

      Urgent request , i have to finish this  code with the help of scripting .

       

      i am having 200 files in a folder , previously i have got error adobe illustrator not responding , and then i have got parm error all these problems now it is rectified , but now i am gettting error ("adobe illustrator can't finish previewing there is not enough memory in illustrator" ) after running for 100 files . can any one suggest me to add line to clear memory in illustrator so illustrator cant occupy any memory .

       

      this is my part of the code, please help me it is so urgent ,sorry to disturb u all .

       

       

       

       

      function read_ai()
      {
          sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files', '~' );
          files = sourceFolder.getFiles(/\.(svg|ai)$/i);
          sourceFolder1 = Folder.selectDialog( 'Select the folder to save ai files', '~' );
             if(files.length == 0)
      {
        //alert("Folder doesnot have any file");  
      
          }    
      
          if ( files.length > 0 )
           {
           //    //alert(files.length);
      
            for ( var file_iteration = 0; file_iteration < files.length; file_iteration++ )
           {
                   var compare_title_name_fn_called  = 0;
                 fileArray_title=[];
             sourceDoc = app.open(files[file_iteration]); // returns the document object      
       var fileExtension = sourceDoc.name.substr((sourceDoc.name.lastIndexOf('.') + 1));
       if(fileExtension=="ai")
       {
        var yog_lays= sourceDoc.layers;
          connector_array_inside_grp = [];
          for(var layer_iteration=0;layer_iteration<yog_lays.length;layer_iteration++)
          {
              var RANGE_group_check_flag=0;
              var compare_title_name_fn_called=0;
          if(yog_lays[layer_iteration].name=="RANGE" )
          {
              RANGE_group_check_flag=1;
              var yog_text=yog_lays[layer_iteration].textFrames;
              for(var text_iteration=0;text_iteration<yog_text.length;text_iteration++)
              {
                 var ref_textframe =  yog_text[text_iteration].textRange.characters[0].size;
               if(ref_textframe==12)
               {
                   
                  fileArray_title.push(yog_lays[layer_iteration].textFrames[text_iteration].contents);
                  }
              }
          }
         
         else if(yog_lays[layer_iteration].name=="Layer 1")
          {
               LAYER1_group_check_flag=1;
               var yog_grp=yog_lays[layer_iteration].groupItems;
              for(var text_iteration=0;text_iteration<yog_grp.length;text_iteration++)
              {
          if(yog_grp[text_iteration].name == "<CIRCUIT TITLE>")
                {
                   fileArray_title.push(yog_grp[text_iteration].textFrames[0].contents); 
                   }
               }
           }
       }
      if(fileArray_title.length==1)
      {
           color_empty_pathitem();
            remove_fuse_group();
              check_fuse_ungroup();
              rename_fuse_group();
               check_connector();
               check_connector_grp();
               check_connector_callout();
               move_rectangle();
               group_connector_name();
                check_text_empty_high();
                 line_check1_unit_CAN(fileArray_title[0]);
                line_check1_unit_2_CAN(fileArray_title[0]);
                
                 wave_unit_check();
                 rectangle_inside_path_items_check(fileArray_title[0]);
                     variant_terminal_check(fileArray_title[0]);    
                   group_Circle_name_CAN(fileArray_title[0]);
                     checking_circleGroup_CAN(fileArray_title[0]);
                  check_unwantedline_CAN(fileArray_title[0]);
                     renaming_path(fileArray_title[0]);
                     renaming_CAN(fileArray_title[0]);
                   line_pathitem_inside_CAN(fileArray_title[0]);
                   
                             check_AAA_names();
                               error_check();             
                                                                                                                                                                                                    
                      }
                  var saveOptions = new IllustratorSaveOptions();  
            var ai8Doc = new File(sourceFolder1);  
            
            sourceDoc.saveAs( ai8Doc, saveOptions );  
            sourceDoc.close();
                  }
              }
          }
      }
      
        • 1. Re: ID=-108 error
          karth80472045 Level 1

          anybody please help me !!! i am strucking with this code

          • 2. Re: ID=-108 error
            O2 Creative NZ Level 1

            I don't believe there is a way without restarting illustrator, I remember reading in the official notes/documents somewhere that its a known problem and the only solution is to restart illustrator. I suspect its just memory leaks in illustrator which Adobe have got around to fixing because the average user wont encounter the problem.

             

            Also the JavaScript engine in Illustrator is persistent, so any memory leaks there will also be a problem or require a restart.

             

            Perhaps modify your code to check the destination folder, and if the file has already been processed and saved then skip it, that way you can just re-start illustrator and get the script to pickup from where it left off.

             

            Glenn Wilton

            O2 Creative

            • 3. Re: ID=-108 error
              karth80472045 Level 1

              thank You very much sir , i have a doubt it is possible to quit illustrator and continue where from file ended in a folder. through scripting ,even i tried this script in this link  [Illustrator] Relaunch AI to aviod "PARM" error · GitHub  , this script says it will restart illustrator once illustrator not responding.