How to create a new text document in LibreOffice with shortcut?

I would like to hit F5 and a new, empty Libreoffice text document is being opened. But I just can’t a way to do this. Any guidance? Thanks!

Here's a macro:

Open a new text document in LibreOffice.kmmacros (2.5 KB)

You can change the "Pause" action to longer or shorter, depending on how long it takes LibreOffice to start running.

Cool, thanks Dan! I had to adopt it slightly for the German version but it works like a charm!

Here is a pattern, using TextWrangler, that I use to handle opening a new document in an app. Instead of a large fixed Pause, I use a Pause Until with a condition that exists when an app starts up, followed by a short Pause.

Ooh, much better. I was thinking something like that, but my brain just didn’t get there.

I also like the distinction of whether it is currently running or not.

Thanks!

Glad it worked!

I assumed you wanted to be able to press F5 while you were in any application, to launch LibreOffice and start a new text document. Right?

If you only want the F5 to work like this when you're in LibreOffice already, let me know.

Hey Wolfgang,

Here's how I'd do it.

-Chris


LibreOffice → Open New Writer Document.kmmacros (3.4 KB)

I assumed you wanted to be able to press F5 while you were in any application, to launch LibreOffice and start a new text document. Right?

Yes, that's correct.

Thank y'all for the different solutions. I shall try them all.

1 Like

It is a bit tricky. I am using the App store version of LibreOffice called LibreOffice Vanilla. The problem is that the keystrokes vary depending on how “open” the program is. At launch you get a selection of the type of document that you want to create. Once you have chosen one, the keystrokes are different if you want to create a new text document.

I wonder if there isn’t a shell script to launch the writer part of LibreOffice directly… Will report back.

I assume the actions are also in menus, so you can use various KM features to check to see if a particular menu exists, and if they do, select one.

1 Like

Ah, finally, success! Thanks Dan, your solution did the trick.

1 Like

Woo hoo! Glad we finally got it working!