Recent files

Hey guys
I have tried the “Recent Files List” plugin to see a list of recent Files

Just wondering if an inline code exists to get list of recent Files on by “Home Page”
something like

-- List of recently created Files
$=dv.list(dv.pages('').sort(f=>f.file.mtime.ts,"desc")

Thank you

What I’m trying to do

List of most recent Files to appear a in Document “Home Page”

Maybe with DataView (which I don’t use). I don’t think it can be done without a community plugin.

The Quick Switcher shows a list of recent files before you type anything in it. It’s not embedded in a file, but I use it because it’s easy and built-in.

Thank you for looking at it
The code is for Dataview, wondering if cud suggest code for Recent Files

Thank you

Well, maybe you don’t want to see ALL the files in your vault, only a top 10:

`$=dv.list(dv.pages().sort(p => p.file.mtime, 'desc').file.link.limit(10))`

Thank you mnvwvnm, this code gets recently modified files, I was looking for recently opened files
Thank you

Info about open files isn’t an implicit metadata. Per se dataview can’t access to that information.
I think you need to search some data exposed by Obsidian API.
Inside app.workspace there’s lastOpenFiles which cache the last 10 open files.
So, try this:

`$=dv.list(app.workspace.lastOpenFiles.map(x=>dv.fileLink(x)))`
1 Like

Thank you mnvwvnm →this works perfectly, thank you

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