I found a post here that talks about a possible way to find PDFs using DataviewJS, but I couldn’t get it to work.
What I’m trying to do
Basically I’m scanning in my son’s homework from Kindergarten and placing them in a folder called “Scans” in his “Kindergarten” folder. I have a note called Kindergarten+ (I add plusses to all my dashboards like I’m a streaming service for some reason, lol) and I’ve been manually linking to his scans.
I’d rather just run a quick dataview code that can just list everything from his Scans folder by created time.
Can you give some more information how exactly your (failed) code looks like?
Besides that, if all pdfs reside in just one folder and this folder only contains the files you want to list, some simple query like this should probably work:
TABLE file.ctime AS created
FROM "Scans"
SORT file.ctime DESC
Evaluation Error: SyntaxError: Unexpected identifier
at DataviewInlineApi.eval (plugin:dataview:19669:21)
at evalInContext (plugin:dataview:19670:7)
at asyncEvalInContext (plugin:dataview:19680:32)
at DataviewJSRenderer.render (plugin:dataview:19701:19)
at DataviewJSRenderer.onload (plugin:dataview:19285:14)
at DataviewJSRenderer.e.load (app://obsidian.md/app.js:1:852538)
at t.e.addChild (app://obsidian.md/app.js:1:852939)
at t.addChild (app://obsidian.md/app.js:1:1242194)
at Object.addChild (app://obsidian.md/app.js:1:1241219)
at DataviewApi.executeJs (plugin:dataview:20210:19)
I’m still using the public version of Obsidian, not the insider one (v.016). Because that I don’t know if there’s any changes with app.vault.getFiles()
About the syntax error, you can try without the emoji? You don’t need to use the full folder path. Try just file.path.includes('Kindergarten/Scans')
More problematic will be the sort thing… because you can’t use the file.ctime but stat.ctime inside app.vault.getFiles()…
And play with dates inside JS is (at least for me, a js dumb) a painful thing.