Implementing Wordle in LibreOffice with JavaScript macros It is the Month of LibreOffice—time to be awesome with LibreOffice, whether that's spreading the word, supporting others, translating, documenting, bugfixing, or coding new features! Given that LibreOffice is looking for developers to improve the scripting support and change their current JavaScript runtime (Rhino), I wondered... What's scripting LibreOffice in JavaScript like, today? (Spoilers: it's hard to start using JavaScript macros, but they work surprisingly well! ✨) A game of Wordle inside of LibreOffice Download the MP4 video. Video demonstration of playing Wordle in a LibreOffice Writer document To answer that, I experimented: can I make a simple game inside LibreOffice Writer? I decided to make a Wordle clone, as the input method was very fitting: player enters words one at a time, and whenever they press "Enter", the game scores their guess. Scoring could be done by highlighting the letters of a word, which is already a feature of Writer! In that respect, I'm quite happy with the final result that you can see above; my initial idea translated very well into LibreOffice's scripting API. (You can even try the final result for yourself in the Codeberg repository!) Starting out Coming up with an idea is easy. Getting code to execute is much harder. LibreOffice's documentation is sorely lacking when it comes to writing macros. There is a page on Scripting LibreOffice which tells you that it is possible to use JavaScript, and directs you to the LibreOffice API where you... won't find anything about JavaScript, except a single support class. The Document Foundation Wiki is more useful, with the Developer's Guide on Scripting Frameworks, which at least points you to the "Organize Macros → JavaScript" menu option However, the Developer's Guide lies to you, saying that "[The Organizer dialog for JavaScript] allows you to run macros and edit macros, and create, delete and rename macros and macro libraries." ...
First seen: 2025-11-18 09:49
Last seen: 2025-11-18 09:49