What exactly is the issue ? your code looks Nothing but fonctionnalités to me ! Unless the condition does not exist on the document.
The condition "xxx" exists in the doc and applied to some parts of text.
What I would like to do is make appear/disappear the text playing with the visibility of the condition!
Of course, with the same shortcut associated to the script.
So, if the text is "visible", the script hides it ; if hidden, the script shows it!
I was too quick saying tour code is fine
You are not using a comparison operator ( i.e. == or === ) but actually you are using only one = sign which is assigning a value.
So use :
- var myDoc = app.activeDocument;
- var myCondition = myDoc.conditions.itemByName("xxx");
- if (myCondition.visible == true) myCondition.visible = false;
- else myCondition.visible = true;
Aha! Goal! I still have a lot to learn!
I never give 1/2 answer! so Yeap!
If you want, Kartik, I let you finish! …