Quote:
would it be possible to have a utility in opus which grabs all the text being used in a publication and outputs it as a text file. this is before it is published, in the opus editor.
lukemcurley
Quote:
Both the extraction of the text and parsing of variables from a DB / INI could be achieved using OpusScript and a little forethought.
Mack
I think Mack's right, especially about the 'forethought'. Well... maybe more right about OpusScript!

Wonderful tool.
Currently Opus enables you to Export current variables. All you have to do is go to Publication and Page Properties >>> Variables Tab... then select All or some subset. That will enable the Export button.
For the text 'round up' (i.e., gather and harness), if anyone wants to tackle this here are a couple starter pieces of the puzzle.
First, Brenden Knifton of DW did a neat implementation/starter_pub for an export-to-disk (.html file) and print of same output.
Here:
viewtopic.php?t=442&highlight=print+html2
A couple notes on that.
- it is currently set up in the download .imp to handle TextInput Objects on 'a page' where those objects have variables associated with them.
- -- to do this more universally, you will have to identify more variables... and if you want to include standard TextObjects that do not have a variable to populate the text, then you need to work with SetSelection() and GetSelection() for each of those objects.
That may sound like a discouraging uphill trek. But continue.
- I posted a script you can run on any Pub during development of the Pub, to document all of its objects in a tree structure. ('all' being ~8 levels anyway). The
key point here is that script runs through the Pub's full object hierarchy quite well.
- -- I think all you'd have to do is add a FILTER that would GetType() == "Text"
- - -- -- and then work on getting at the text 'selection' or the applicable variable for those objects -- accumulate these in Brenden Knifton's approach.
- - -- -- BTW, don't forget Button Objects. So in addition to the above Filter, add type == "Button", and get the Child of the Button (it holds label text)
I managed to play around with the Structure/Tree output when I developed it -- it was very easy to Copy the output and Paste it into Excel. Pic attached. (don't know if I tweaked it after posting the script, but just let me know if needed).
Here:
viewtopic.php?t=3619&highlight=structure
BTW -- I made this Tree structure script partly for documenting and viewing and partly in anticipation of wanting to save Object positions and states ... so if you have anything along the lines of Saving / Restoring states, I'd sure like to hear/get some help there.