Open note with the oldest modification date

Hi there,
I was wondering what would be the way to go to create a keyboard shortcut which would open the note with the oldest modification date.

Would it be possible to create a command for this using the shell command plugin ?

I feel like this would be possible with templater.
the template would contain code that identified then opened the oldest modified note. you could bing insertion/execution to a shortcut

Ok, I found the solution. It is possible to add the following command in the Obsidian shell plugin:

open "obsidian://open?file=$(find . -name "*.md" -type f -not -path "*/.*" -print0 | xargs -0 ls -rt 2>/dev/null | head -1)"

looks for the .md file with the oldest modification date in the vault’s root folder and its subfolders

2 Likes

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