Simple edits and saves from the command line for write

I would like to be able to open an existing file in Write, edit one of the custom properties (File > Properties > Custom Properties), and then save the modified file to a new destination, all entirely from the command line.

I see that some simple operations are possible from the command line (e.g. export to pdf) but I haven’t seen anything explaining how to make changes to the contents of a file.

Is something like this possible? It would greatly facilitate some batch file processing that I regularly have to do.

I don’t know of options to generate content via command-line. I think the files are to complex for this.
But there are other Options:

  • there is a listening mode where LibreOffice accepts comnands via a socket. I would steer this not from command-line, but from a programming language like python.
  • the command-line allowes to start a macro directly. If this macro happens to contain your simple editing and save, it could be your solution.
  • If your documents are simple you may generate them as simple .txt and just convert the text to .odt, as you already know of the -convert-to option

Depends on the details of your project

To illustrate some options: blog
Old OO wiki