Complete beginner with LO extensions in javascript. Advice etc. needed for port from MS Word

Hello,

For WIKINDX (https://wikindx.sourceforge.io) for which I am a developer, I have created a MS Word add-in. Wikindx is like Endnotes/RefWorks on steroids so the add-in allows the importation of references and citations into the document formatted as per the required style (APA, Harvard, Chicago etc.) with the bibliography also ordered as required. Need to use a different style or order? Simply click on a button and your paper is transformed.

This is my first experience writing an add-on which has been in javascript but I’m discovering that it is not easy releasing a MS Word add-in to the public (and my wikindx users). While developing that add-in, the intention was to also develop a LO extension but, given the deployment blocks that MS seems to put up, that intention has been given added impetus.

So, my question is, where are the LO extension javascript tutorials? This site (Development/Extension Development - The Document Foundation Wiki) states javascript can be used but all the documentation/samples/snippets I can find (e.g. Extensions development - Apache OpenOffice Wiki and elsewhere) are in languages other than javascript. I cannot find anything on javascript. The first site above also states I need the SDK — having downloaded it, as far as I can tell, it is nothing to do with javascript (and none of its sample code is). Is javascript supported at all (and can javascript extensions be made available on extensions.libreoffice.org)?

If the recommendation is not to use javascript, which supported extension language is best suited to adapt my MS add-in javascript quickly (for someone who learned C about 30 years ago, transitioned to Perl and then PHP and can hack his way through javascript)?

Regards,

Mark

I believe we have some sort of JS support that is implemented using some Java library, and which nearly no one uses, with unknown level of stability: tdf#97827. I’d suggest to look at Python.

By the way, Macros/General - The Document Foundation Wiki lists a resource with some javascript info.

Thanks Mike,

I guess I will be learning python then. A couple of other questions if I may.

  1. Can I assume that a python extension can be uploaded to extensions.libreoffice.org (i.e. it is not just for executable objects)?
  2. If a user downloads a python extension, does he/she need to install python?
  1. Do not answer your own question unless it is a real answer.
  2. Core Python is bundled with LibreOffice.
  3. The extensions site hosts all kinds of extensions.

Apologies Gabix and thanks for the answers.

If python is bundled with LibreOffice I can’t find it (after wading through a lot of conflicting/out-of-date web pages).

On MacOS (Interface-oriented programming in OpenOffice / LibreOffice : automate your office tasks with Python Macros), I launch writer with:
/Applications/LibreOffice.app/Contents/MacOS/soffice --writer
–accept=“socket,host=localhost,port=2002;urp;StarOffice.ServiceManager”

Writer opens up.
Then run:
/Applications/LibreOffice.app/Contents/MacOS/python
but ‘python’ is not found (it’s certainly not in the folder above).

https://wiki.documentfoundation.org/Development/Extension_Development/Python_Extensions_Development says I need to install the UNO package. But that’s already in /Applications/LibreOffice.app/Contents/MacOS/ – despite that, ‘import uno’ reports it cannot be found. I guess that is something to do with LO’s python not being available.

One, up-to-date LO python tutorial for MacOS that will get my dev environment up and running?