Hello,
I am trying to write a script that will check to see if a style already exists in a document. If it does, fine, I'll use it. If it does not, then I want to create the style. The following script errors out, telling me there is an invalid parameter.
if(document.objectStyles.item().name !== myCharStyle){
var myCharStyle = myDoc.characterStyles.add({name:"myCharStyle"});
}
I have tried using the try/catch function as it is written in Adobe's InDesign Scripting Guide: JavaScript but this also just errors out.
Thanks,
Tom