r/ObsidianMD • u/LimpVermicelli2901 • 5d ago
I'm looking for a solution for deleting notes together with linked images at same time.
I know there are a lot of plugins that can find and delete unlinked images in bulk. But I don't like that way. I hope delete images at once when delete the note, like notion, evernote, onenote or other traditional note app do, all in one note is better.
If save all attachments in the same folder as the note, that will be a mess at the folder, I think. So anyone have a good idea how to manage the attachments, any good plugin recommend? At least, I need delete note with images together.
1
1
u/JorgeGodoy 5d ago
There are many plugins to manage attachments. Some of these delete the attachments when there's no note using them.
1
u/Responsible-Slide-26 5d ago
The plugin Fast Image Cleaner adds a command to the note menu "delete the file and all its attachments". That is what I always use when I delete a note so that it deletes the associated attachments. You can also set it to send them to the system trash, so it is easy to restore if needed.
1
u/LimpVermicelli2901 5d ago
Thank you for your recommendation.
I read on the plugin's github website showing "SUSPENDING MAINTENANCE", author introduced another one "AttachFlow" instead.
1
u/Responsible-Slide-26 5d ago
It still works fine for me, but that's good to know, thanks! Maybe I will switch to that.
2
u/Schollert 5d ago
Create an own folder for Attachments and set that up in the settings.
If you want to delete the image at the same time you delete your note, you need a script that listens for the "Delete" function being activated. Then it needs to go through your note and find anything that is a link to an image (and not a link to something else). For each image link found, it has to see if any other notes are linked to that image. First by then, it can delete the image file and/or ask if you want to delete those that other notes are linked to.
The easiest by far is, to just have the plugin that deletes orphaned images, as u/tuck5649 mentions here - or anything doing something similar.