obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Queries for Non-markdown files

Open Archie-2021 opened this issue 2 years ago • 5 comments

Can you add a feature to include non-markdown files for basic stuff like file name. It would be nice to choose in the query this option as I understand that this could disrupt other types of searches.

Thanks

Archie-2021 avatar Jul 26 '21 14:07 Archie-2021

Would also like to see this, as I would love to query for specific attachments based on date uploaded, or a string in a filename.

WyldKard avatar Oct 27 '21 18:10 WyldKard

Agreed - definitely a pretty basic and useful feature to support.

blacksmithgu avatar Nov 06 '21 00:11 blacksmithgu

I would also like this feature, i want to find orphans inside my notes

sandorex avatar May 10 '22 19:05 sandorex

I have a workflow where I dump PDFs in a folder (most converted from web pages I'm reading). So I need a query to show my queue of PDF articles to read and annotate. I wonder if there's any other way to do this?

huyz avatar Jul 27 '22 10:07 huyz

Non markdown files have minimal metadata like creation time, modification time, etc but getting a list of them requires DVJS and the Obsidian API.

AB1908 avatar Jul 27 '22 11:07 AB1908

Related (I think): I would love a way to get something like the obsidian search results. Like what you get with

```query
path:"SD Content/Attachments"
```

but similar to:

```dataviewjs
const pages=dv.pages('"SD Content/Attachments"')
```

maybe

```dataviewjs
const pages=dv.search('path:"SD Content/Attachments"')
```

They probably still could use the page object for real pages, but just basic information for the other files.

This way, it would be possible to create image grids or even a listing of attached files for notes with dataviewjs.

Note: I am new to dataview and obsidian and on the search on how to get to the filenames of the attachments in that folder. The images in there are stable diffusion grids with results for different queries by author. The authors names are in the filenames like sd-grid-H. R. Giger.jpg and I would like to have a page where all the results show up. I could write that as a script outside of obsidian, but I think it would be nicer to do it "on the fly".

oderwat avatar Oct 10 '22 16:10 oderwat

Should we close this in favor of #234 ?

AB1908 avatar Oct 29 '22 21:10 AB1908

With that hint from #234 I actually got my problem solved like in this example and be fine with it:

```dataviewjs
var images=this.app.vault.getFiles("SD Content").filter(t=>t.name.substring(0,13)=="Artists-Grid-");

images.sort(function (l,u) {
    return l.name.toLowerCase().localeCompare(u.name.toLowerCase());
});

let adapter = app.vault.adapter;
let basePath = adapter.getBasePath()

for (let file of images) {
	dv.el("img","test",{ attr: {"src" :   
"app://local"+basePath+"/"+file.path.replace(/ /g,"%20")+"?"+Date.now() }});
}

It did not work well with just using ![[]] embedding, though.

oderwat avatar Oct 29 '22 23:10 oderwat

Good to hear! Feel free to reopen if that diverges from this issue

AB1908 avatar Oct 30 '22 07:10 AB1908