Random PARM-Error when scrpting
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?
