Copy link to clipboard
Copied
@frameexpert I have an existing script to show/hide conditional text in a document - see https://community.adobe.com/t5/framemaker-discussions/estk-script-line-to-refresh-show-hide-conditio...
In FrameMaker, the Show/Hide Conditional Text pane works on the book level, so I thought I could just change all references to doc in my script to book.
I'm getting an error on book.GetNamedObject (Constants.FO_CondFmt, "Format 1");
I noted in the FrameMaker Scripting reference, there is app.GetNamedObject and doc.GetNamedObject, but no book.GetNamedObject.
I'm assuming I will need to open the first doc in the book to get the conditional format names, and then process each document in the book to show/hide them.
I think I can figure out how to do that (thanks to https://community.adobe.com/t5/framemaker-discussions/searching-a-book-using-extendscript/td-p/13268... and similar) - I just want to make sure there isn't a simpler solution before I dive too deeply into this.
Thanks in advance!
In scripting, it works at the document level. The book-level control in the FrameMaker interface is just a convenience, but FrameMaker still opens and closes each document.
Copy link to clipboard
Copied
You have to open each document, do the show/hide, save and close it.
Copy link to clipboard
Copied
@frameexpert - Thank you - follow-up, does
if (CondFmt.CondFmtIsShown === 1){
}
work at the book level, or just the doc level?
Trying to determine at what point I need to close the first doc in the book during execution of the script.
Copy link to clipboard
Copied
In scripting, it works at the document level. The book-level control in the FrameMaker interface is just a convenience, but FrameMaker still opens and closes each document.
Copy link to clipboard
Copied
@frameexpert - Thank you - I see the path forward now!!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now