Script for show or hide conditional text in InDesign
Hello everyone
I have a document that use a conditional text, and i need check how the text stay with or without the conditional, in many pages, today i do this showing and hiding the eye in conditional text panel, so, i am trying write a code for atutomate this task.
I am yet in begin
var delay = 50;
var stopCheck = false;
while (stopCheck == false){
if (app.activeDocument.conditions.item("condition_name").visible == true) {
app.activeDocument.conditions.item("condition_name").visible = false;
$.sleep(delay);
} else {
app.activeDocument.conditions.item("condition_name").visible = true;
$.sleep(delay);
}
}
the code worked, I know this because i see the eye in the panel changing, but in the document the text do not hide or show, I understand that InDesign freeze the view, while the script runs.
I try too use the invoke of menuActions, but the result is same
app.menuActions.itemByID(133136).invoke() // Hide
app.menuActions.itemByID(133135).invoke() // Show
somebody knows how i can resolve, or the reason for this
grateful for help
