Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Getting 1346458189 ('PARM') error

$
0
0

From the readme:

"An Illustrator error occurred: 1346458189 ('PARM')" alert (1459349)    Affects: JavaScript    Problem:     This alert may be popped when badly written scripts are repeatedly      run in Illustrator from the ExtendScript Toolkit      Scripters need to be very careful about variable initialization and      namespace conflict when repeatedly pushing a batch of Illustrator scripts     for execution in Illustrator via the ExtendScript Toolkit (ESTK) in a      single Illustrator session. Each script run is executed within the same      persistent ExtendScript engine within Illustrator. The ESTK debugger      uses BridgeTalk to communicate with Illustrator. One global, persistent      ExtendScript engine inside Illustrator handles all BridgeTalk      communications. The net effect is that the state of the ExtendScript      engine is cumulative across all scripts that ran previously.      The following issues with script code can cause this problem:        - Reading uninitialized variables.        - Global namespace conflicts, like when two globals from different         scripts clobber each other.    Workaround:     Initialize variables before using them, and consider the scope of      your variables carefully. For example, isolate your variables by      wrapping them within systematically named functions. Instead of:             var myDoc = app.documents.add();       // Add code to process myDoc           Wrap myDoc in a function that follows a systematic naming scheme:             function myFeatureNameProcessDoc() {      var myDoc = app.documents.add();      // Add code to process myDoc      }      myFeatureNameProcessDoc();

 

 

This makes zero sense to me. If javascript variables are being reused or 'clobbered' or your javascript is 'poorly written' (this is not defined) it should have no effect on the scripting engine. Errors should cause exceptions to be thrown, which can be caught by the script.  I'm getting these errors when I try to evaluate properties of valid objects, for instance trying to access pathItem.fillColor. It's happening in various (almost random) lines in my script. Javascript doesn't have namespaces so I don't know what a 'namespace confilct' would be. Accessing variables from nested functions also seems to be a problem.

 

Edit - this seems to be related to accessing global variables or variables defined in containing functions. For now, adding var to the first use in subfunction seems to have fixed the problem. What is strange is you don't get an undefined variable error, it just crashes when it tries to access the properties.

 

Edit - still not fixed. I'm guessing it has something to do with memory allocation, because I am processing a lot of big raster images in todays batch of files.

 

Edit - processed 84 files today with no errors the pattern I'm using is to use a bach file that loops

 

"(Path)/Extend Script Toolkit.exe" -run script

sleep 10

 

The script opens a group of files (in my case JSON files), processes one file, exports an ai file, deletes the JSON file, then exits.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>