Collabora Office 21.06 Help
The Python script files are stored in the filesystem, in folders controlled by Collabora Office. The macros can be started at installation, user or file level.
Refer to Getting Session Information in order to get programmatic access to Python script locations.
Existing macros in this location (container) were copied by the installation program and are available to every computer user, and any open document can access macros stored the container. You need administrative rights to store or edit macros here.
The Collabora Office Macros container location in the file system depends on the operating system:
For Windows: {Installation}\share\Scripts\python.
For Linux and macOS: {Installation}/share/Scripts/python.
This container is accessible only by the Collabora Office user. Any open document can access macros stored the container. Macros in this location are stored in the Collabora Office user profile.
The My Macros container location is in the user space and depends on the operating system:
For Windows,
%APPDATA%\LibreOffice\4\user\Scripts\python.
For Linux and macOS,
$HOME/.config/libreoffice/4/user/Scripts/python.
Document macros are embedded in the document and are accessible only when the document is open.
Like BASIC macros, Python macros can be organized in libraries, modules and macros.
Libraries are folders in the container tree. To create a library, add a folder in the target container. The library name is the folder name.
A module is a python file in the library or the container. Create a module adding a file in the container.
A macro is a python object in the module.