Handling conditional text
Hello fellow Frame automators,
I am looking for some insight and advice how to tackle a problem with conditional text in unstructured FM. I have a bunch of documents with many conditional elements. The client has used up to 25 conditions. I am converting their documents to structured FM and want to move the conditional text into phrase elements with an attribute that specifies the condition. This makes it much easier to handle and allows better roundtripping to XML later in the project.
So how do I get the conditional text pieces wrapped into phrase elements and set the correct attribute ? I was looking for condition markers in the converted documernt, as the automatically generated Conversion Table does list an element M: Conditional Text. But it does not seem to use that marker at all. The conditional text is kept in the converted document. And using a simple script I walked through all the Marker objects in the document (via the list that starts with FirstMarkerInDoc) but there are no condition markers in that list either. It looks like the condition markers are a totally different kind of animal that just happens to go by the same name...
So how do I find the conditional text ? If I use the Find dialog, it allows me to search for conditional text, but there is an extra dialog specifying which conditions to look for. I have not even figured out how to find ANY conditional text using that dialog (as I have never used FM's built-in method for conditional text).
How do tell the ExtendScript Find method to find me any conditional text ? And how do I then find out which condition was set for this text ?
Thanks for your advice and ideas
Jang
