Javascript
Libreoffice
In fact, in LibreOffice/OpenOffice, one can use Basic, Python, Java and JavaScript. Macros can be embedded in documents and triggered from certain actions in the document.
Running JavaScript macros in LibreOffice - [1]
Google Sheets
Google sheets can be scripted with Javascript to add functionality and automation to spreadsheets.