Special > Remove Structure from Flow removes the element hierarchy from a flow, leaving the content unstructured. It may created new paragraph formats that maintain the original appearance.
If you want to remove the element catalog from the document, import element definitions from a document that does not have any element definitions.
thank you Lynn,
I like to remove the structure within an extend script.
My script is: 1. open xml-file, 2. save as fm, 3. remove structure 4. save as in an older fm version.
-> it runs all fine, but only how I can remove structure I could'nt find in any extendscripts-guides.
Importing an empty element catalog don't remove structure and destroy all formats.
I think this shoud do the Job.
var rangeArray = new Array() ;
var flow = app.ActiveDoc.FirstFlowInDoc;
var firstPgf = flow.FirstTextFrameInFlow.FirstPgf;
flow = flow.NextFlowInDoc;
var range = new TextRange() ;
range.beg = new TextLoc() ;
range.end = new TextLoc() ;
range.beg.obj = firstPgf;
range.beg.offset = 0 ;
range.end.obj = range.beg.obj;
range.end.offset = 0 ;
for(var i=0; i < rangeArray.length; i++)
app.ActiveDoc.TextSelection = rangeArray[i];
FA_errno = 0 ;
var cmd = app.GetNamedCommand ("RemoveStruct");
var fcodes = new Array(); //Fcodes
Fcodes(fcodes); // Fcode Execution
thank you very much! Actually I get after removing structure a dialog like this "structure will be removed - you like really?".
And so I look to find the fcode for closing dialog with ok.
best regards :-)
yes. right. there is such a boring message :-)
You can confirm this with an FCODE or ExtendScript, AFAIK...
If you want to automate this, you need to fire an event from an external application or thread. This can't be done by ExtendScript.
There are tools like "Push that freaking button", which can do that work as a Background worker. Macro Recorder and Mouse Auto Clicker
I'm sure it was for free in former times. Currently it costs $39,99. But even cheaper than implementing this by one self.
do you confirm, that fcode works without showing any dialog, because you set the textselection?
It works fine. Thank you very much.
a Long time that I used it at last, but I think a Dialog appears any time a flow with structure was recognized and fcodes excecutes...
If so, you have to workaround that, as mentioned