Automatically rename notes by title?

Things I have tried

Manually renaming them?!

Automatically rename notes by their title inside the .md file

So basically what I’m trying to do is to batch-rename all .md note files according to the title that is inside the .md file. I recently jumped from Trilium Notes to Obsidian. Unfortunately, when I exported the notes from Trilium in order to import them to Obsidian, Trilium exported them with shortened filenames.

Now when I open them in Obsidian, the content inside is fine, but the filenames are shortened arbitrarily. For example, instead of the note being named “Ideas for books to write.md”, it now is named as “Ideas for books .md” or similar.

How can I fix this? Is there a way to automatically rename all .md files according to their #title?

I don’t want to do it manually–we’re talking hundreds of notes here :smiley:

Would this help you?

Ahh, but it’s not free & also only for Mac. I don’t have a Mac. :confused:

You could certainly knock up a python script to do this. I don’t have time to do it for you, but it is not a complicated bit of programming if you use regular expressions

  • open all the .md files in your vault one by one
    • for each one
      • look for the first heading 1 line ( ^#\s.+$)
      • copy that
      • rename the file to the heading
      • close the file
    • next file
1 Like

Would the obidian-filename-heading-sync plugin be of help? I use it all the time and it seems to work well. You can find it in the Community Plugins section of the Obsidian’s Settings.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.