ESTK Script line to refresh Show Hide Conditional Text Pane needed!
FrameMaker 15.
I have a simple script to prompt and update whether conditional text formats are shown. It works fine. However, FM does not "Visually" update the Show/Hide Conditional text pane, until I click to a different pane and back to it.
This causes the following issue:
Format 1 is initially hidden. User runs script and clicks to show Format 1. Scripts shows Format 1 and updates document, however, Format 1 appears hidden in the Show/Hide Condiitonal text pane, if that was active when the script was run. User does not click another tab in FM and hides Format 2 and clicks Apply. Format 1 is now hidden also b/c it was visually under Hide, so apply hides it as well.
I need a line that I can add to my script so that the Show/Hide Conditional Text pane displays properly. Alternately, the script could just manually select some other pane or close the Show/Hide Condiitonal text pane, which would mean that when the user opened it, it would be refreshed and show the valid information.
This is an example of the current script:
var doc = app.ActiveDoc;
SetConditionalText (doc)
function SetConditionalText(doc){
var CondFmt = doc.GetNamedObject (Constants.FO_CondFmt, "Format 1");
if (CondFmt.ObjectValid()){
if(!Alert("Should Format 1 be shown?", (5))){ // (5) - is Default No - Page 1017 FM Scripting. Alert (Cap) is ESTK, alert is JS.
//alert ('Format 1');
CondFmt.CondFmtIsShown = 1; // 1 for show, 0 for hide.
}
else{
// alert('Not Format 1');
CondFmt.CondFmtIsShown = 0; // 1 for show, 0 for hide.
}
} // Format 1 not valid.
} // End SetConditional Text
Worst case, I can add a final Alert pop-up to say "Click away from the Show/Hide Conditional Text Pane before continuing.", but that seems like a very unprofessional solution.
Thank you in advance!
