Skip to main content
Participating Frequently
January 10, 2023
Question

Random PARM-Error when scrpting

  • January 10, 2023
  • 4 replies
  • 958 views

Hello!

 

I'm writing a small script to copy some elements in Adobe Illustrator through the JS-Interface. When testing, I sometimes get a "an Illustrator error occurred: 1346458189 ('PARM')"-Error which only sometimes happens. I develop in Visual Studio Code with the ExtendScriptDebugger extension. When trying to debug the error in the debug console, I get this behaviour:

 

> tf.textRange.characterAttributes.size
an Illustrator error occurred: 1346458189 ('PARM')
> tf.textRange.characterAttributes.size
20
>  tf.textRange.characterAttributes.size
an Illustrator error occurred: 1346458189 ('PARM')
>  tf.textRange.characterAttributes.size
20
>  tf.textRange.characterAttributes.size
an Illustrator error occurred: 1346458189 ('PARM')
> tf.textRange.characterAttributes.size
20
> tf.textRange.characterAttributes.size
an Illustrator error occurred: 1346458189 ('PARM')
> tf.textRange.characterAttributes.size
20

 

tf is a TextFrame object but every second lookup of the fontsize fails with the given error and I have no idea how to debug that behaviour.

In my script, I start with the current document of the user, create a new document and copy some elements into the new document. tf is one of the copied textframes.

 

Any ideas?

This topic has been closed for replies.

4 replies

pixxxelschubser
Community Expert
Community Expert
January 11, 2023

It may be that some of the solutions suggested here will help, but maybe not (best read through at your leisure).

https://community.adobe.com/t5/illustrator-discussions/illustrator-scripting-bug-list/m-p/7625798#M153989

CarlosCanto
Community Expert
Community Expert
January 10, 2023

can you post your script or a working version that we could try to troubleshoot?

Participating Frequently
January 10, 2023

I'd like to, but I'm not able to upload an illustrator file and the script expects some specific elements in the graphic  I only get this error:

Correct the highlighted errors and try again.

  • The attachment's teddy_star.ai content type (application/postscript) does not match its file extension and has been removed.
Larry G. Schneider
Community Expert
Community Expert
January 10, 2023

You should be able to post the .jsx file here as it is just a text file. We don't really need the AI file.

Larry G. Schneider
Community Expert
Community Expert
January 10, 2023

Try using the index backwards. 

Participating Frequently
January 10, 2023

Which index do you mean?

Anubhav M
Community Manager
Community Manager
January 10, 2023

Hello @Nikolas27279722qnnw,

 

Thanks for reaching out. Would you mind trying the suggestions shared in this community post https://community.adobe.com/t5/illustrator-discussions/an-illustrator-error-occurred-1346458189-parm/td-p/3033199 and checking if it helps?

Looking forward to your response.

 

Thanks,

Anubhav

Participating Frequently
January 10, 2023

I tried to declare the variables within the loop as var outside of it.