Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Processed 84 files today with no errors the pattern I'm using is to use a batch 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.
Also, run the script file out of the Adobe Scripts folder so you don't get the security prompt.
Copy link to clipboard
Copied
I was troubled by this bug for a long time as well.
But I have now found a very simple way, for now at least, that seems to perfectly resolve the issue:
Simply press the TAB key before running your script!
What that does is to remove all panels from the illustrator UI. And I believe the bug is related to illustrator wanting to create thumbnails in the layers panel (or other visual effects) when every doc is opened, and when you're batch processing files and modify their layer contents, illustrator can't keep up and gives you the PARM error.
I have a huge processing script that amongst other things moves every layers artwork into new artboards. I have to unlock and make the objects visible as well. Anyhow, my script rendered random PARM errors. I tried so many things; breaking up the code into small functions, pausing between documents, and many other things. Nothing worked. But the TAB-key has worked flawlessly for batch processing all my files for about ten times now.
Please note, this solution only worked when running the script from within illustrator. So place the script in this folder:
C:\Program Files (x86)\Adobe\Adobe Illustrator CS4\Presets\en_GB\Scripts
(adjust the path according to your language)
And then run the script from illustrator's the File->scripts menu.
Best regards,
Fredrik Borgström
Copy link to clipboard
Copied
I will have to take a look at this as I get an 'PARM' error and crash when ever I've tried to deal with Pattern Fill objects. Won't draw the screen then fold… no matter how simple the pattern.
Copy link to clipboard
Copied
UERIKA! I found a semi-solution. This error only occurs for me when my illustrator window is "maximised" before I close it. Try to make it so its not maximize before your script opens up Illustrator. 😃 hope this helps.
Copy link to clipboard
Copied
Hello
Just for anyone who will google for the same problem
In my case (also was a huge batch processing with javascript) I've found the solution by inserting a delay between each iteration:
$.sleep(3000);
Maybe even less ms delay will work.
Thank you azgolfer for the direction!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now