How to add/install a macro from the command line on Ubuntu server?

Hi

I have a macro that I need to add/install on an Ubuntu server, with no GUI available, in order to run it headlessly via the command line.

How does one go about this?

Also, how would you update/replace the macro if it needs to be updated/replaced in future?

Thanks

Copy macros in correct path, for macros, for example for macros Basic:

.config/libreoffice/4/user/basic/

for macros Python

.config/libreoffice/4/user/Scripts/python

also, you can always run code directly from a Python script for example.