Cleanup Vault by finding Pasted images excalidraw

What I’m trying to do

I am trying to generate a list of .png files starting with “Pasted Image 202” as part of my cleanup page

for MD files Iuse plain dataview but other files like .canvas I found a dataviewjs script that works. I thought bij just changing the parameters this would also work for pictures that are addedin excalidraw of which I did not change the name yet. Here is the script I use:

const moodFolderFiles = app.vault.getFiles()
	.filter( (file) => { 
		return ( 
			file.path.toLowerCase().includes('Pasted Image 202')
		) 
	})
	.map( (file) => {
		const matches = file.name.match(/([^/]+)\.png$/)
		return dv.fileLink(file.name, false, (matches ? matches[1] : file.name))
   });

dv.list(dv.array(moodFolderFiles).sort(l => l.display, 'desc'));

if I replace Pasted Image 202 for untitled.canvas and .png for .canvas the script works

Things I have tried

searched in forums, narrowed search parameter Pasted Image 202 but no hits appear

Sorry to waste your time, if I change Pasted Image 202 to pasted image 202 (it changes to lower case it works)

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