First line of document as file name instead of Untitled 1

How can I set LibreOffice (especially Writer) to use the first line of my document as the file name when saving it? If this feature doesn’t exist yet, it would be really useful.

There is no built-in setting to achieve what you want as far as I know.

See the solution by custom code here.

My suggestion: Don’t do it. A filename shouldn’t be a kind of an essay, but a thoroughly chosen identifier.

There is a more thoroughly considered “bug” (Enhancement Request) tdf#58685 You may vote it +1.

Hello @natanvarga,

In addition to the macro from @Lupp’s answer above, please also have a look at the macro in my answer here:

The first line does not neccessarily have to be a long essay, it could be just a short Chapter Title or so…

HTH, lib

I didn’t want to put the accent on “essay” (only casual wording) but on “thoroughly chosen”. Of course it isn’t definitely impossible to make a thorough choice by filling a specific element of a text document provided by the template e.g. My definite experience from observing typists using MS Office some years ago: They don’t. (As they refuse to use templates but derive the next letter from the previous one.)