Context:
I produce ODT documents by running an Emacs Org-mode document (a plaintext markup format like Markdown). The document so produced is then passed through a Basic Macro via a command line. This macro does exactly what Tools->Update->Update All does. Passing the document through a macro ensures that (pagenos in) TOC of the ODT document is up to date.
The macro is invoked via command line as below
andsoffice --norestore --invisible --headless macro:///OrgMode.Utilities.Reload(file:///home/kjambunathan/Downloads/test.odt)
OrgMode.Utilities.Reload is a just a shim over
Problem:executeDispatch(..., ".uno:UpdateAll", "", 0, Array())
When working with large documents, the above "UpdateAll" fails. This is probably because the macro's Subroutine exits even before the executeDispatch has finished its work. I have read through the forums, and one of the suggested workarounds for this problem is to add a wait after a dispatch. I am not comfortable with this workaround, I would prefer a macro (Basic, Python or Java whatever) that would __guarantee__ me that the fields are up to date before the shell command exits.
So, Can someone help me with Synchronous API equivalent for executeDispatch(.uno:UpdateAll).