I need a quick start LibreOffice extension creation with python on MacOS Big Sur.
I have a Word taskpane add-in in javascript I wish to convert to LibreOffice writer using python.
I currently have 3.9.2 python installed with LO 7.0.4.2
There are quite a few websites discussing the topic but, unfortunately, many are out-of-date or give incorrect information. However, from combining information from them, I’ve figured out that in two terminal windows I need to run
/Applications/LibreOffice.app/Contents/MacOS/soffice --writer
–accept=“socket,host=localhost,port=2002;urp;StarOffice.ServiceManager”
and
/Applications/LibreOffice.app/Contents/MacOS/Resources/python
Both terminals are left running.
My /Applications/LibreOffice.app/Contents/MacOS/ folder has uno within it. So, apparently, the following should work:
import uno
print("Hello World!")
but I get the error ‘ModuleNotFoundError: No module named ‘uno’’
I’m using variously IDLE and spyder as my editors.
What have I missed?
I have another question. There’s a fair few tutorials on LO python macros. Are macros different to extensions (this is not clear)? I’m assuming there is some useful information there if they are different but perhaps there are some important differences that I have not yet understood and that might lead me down the wrong path. I want to produce a graphical interface (like a Word taskpane) to an external database – so ‘extension’ I think.
Thanks in advance.