In CS4 I am importing an XML file and then exporting a PDF from it. So I have some code which looks like
currentDocument.exportFile (ExportFormat.pdfType, File('file.pdf'), false);
I had rather expected that the import would complete before returning but that doesn't seem to be the case so the export only exports the first page. Once the script is complete then autoflow runs and fills out the rest of the pages. Is there some way to trigger an autoflow between the two lines? I tried just sleeping but apparently that is a locking operation so nothing else runs during the sleep. I also looked for an event which might be fired after the import had really finished but the afterImport event looks like it fires to early for my needs.
Use the "recompose" method on your XML story perhaps?
I did a recompose on the document and that did indeed force a reflow. Many thanks.
.. Wow. Now that was just a wild guess.