Move attachment with notes

Currently (v.0.11.0) in the options, if I set “Default location for new attachments” to “In subfolder under current folder” and “Subfolder name” to “attachments”, any note attachments (i.e. figures, PDFs …) will be automatically stored at “attachments” folder at the same level where the note is created.

However, at most of the time, I will first start my note at some location (i.e. say inbox) and later on moved to some other better categorized path. Even the note can be moved easily, the attachments are not.

Is it possible for the tool to automatically move the attachments any time the note itself is moved? So that I can always easily locate / maintain the attachments and note in the Finder.

For example, if my note name AAA, the attachments are always at AAA_attachments folder at same level. If I move the note from the sidebar, the attachments folder moves automatically in background.

17 Likes

I am using this plugin for that purpose, and it is very helpful:

2 Likes

OP’s question seems (to me at least) to be more about moving some but not all notes from a folder and taking their attachments with them.

The problem I see with this is what happens if you have Note A and Note B both referencing an image in the local attachments folder, and you move Note A but leave Note B in place. Do you leave the image in the local attachments folder and update Note A point to the image in the “old” location? Or do you move the image and then update Note B to point to the image in the “new” location? Or do you copy the image to both locations?

Then there’s the issue of how are existing user workflows handled? For example, my workflow doesn’t need this capability at all, because I either add images to a global folder or to a source-specific folder, so the images will always be attached to their source which is itself in the enclosing folder. So adding this would require either (a) adding a configuration item that increases complexity or (b) changing existing behavior which breaks my own workflow.

I suspect adding something like this opens the door to a lot of edge case complexity and it is probably preferable to keep Obsidian simple, especially since there’s currently a straightforward (but admittedly mildly frustrating for the individual who wants this) manual workaround.

But that’s just my thought.

2 Likes

Yeah, I think there is a general problem for markdown and images and other attachments that is not limited to this app. Html can handle this by saving all in one file but on the other hand html is not as minimal as markdown. Maybe a mid-way solution for images could be possible, as images should be considered minimal in 2021.

@ davecan
You mentioned the case that “Note A and Note B both reference an image in the local attachments folder”, and I think if every note has option to have its dedicated “*_attachments” folder and automatically managed by the note tool, this problem should be solved. Common reference might save some disk space but I don’t think this can be a big deal for nowadays PC hard disk size.

1 Like

if every note has option to have its dedicated “*_attachments” folder

I would uncheck this option with extreme prejudice lol. It simply does not fit at all in my workflow and I’ve never heard of it in any other note tool.

That said, its up to the devs and the community whether adding an option for this is warranted. I suppose it could become just another dropdown in the Default location for new attachments setting.

Out of curiosity, what is your real world use case for this feature?

Yes, I’d suggest this becomes another drop down option in the “Default location for new attachments” as you mentioned.

The use case can be as below:

  • Note can be started quickly at one place but later on be moved to some other places during its life span
  • A lot of screenshot and file attachments can be added to note during updates of the note in its life span
  • If attachments go with note, these attachments are always “attached” to the note no matter how I move them and I can easily locate all of them in the Finder / File Explorer then zipped to share with others who don’t have Obsidian or for other purpose like backup
  • It will also be easier to remove some notes along with attachments quickly in the Finder / File Explorer without checking reference relationships in the Obsidian tool
  • Also it naturally avoids large amount of orphan attachments (i.e. quick screenshots, PDFs or other files) when notes are deleted
10 Likes

I think this would go well with this suggestion, if it gets implemented.

1 Like

Yes, I also think so as long as the attachment folder is kept sync with note (i.e. rename, move, copy …) automatically.

I think this is showing a difference in the overarching strategy behind how different user personas use Obsidian.

@WhiteNoise You may already have these personas developed but if not there seem to be at least two user personas at play here: one that wants a more hierarchical approach for knowledge/reference management, and one that wants a more fluid note-focused approach for Zettelkasten-style knowledge development with attachments relatively decoupled from notes. (I’m in the latter, but do also store some reference/cheatsheet type info in the same vault, but would not want the described function to become a global default for all of my notes)

I may be misunderstanding the persona here, and I’m sure there’s other personas as well.

This could be an interesting feature for certain personas as long as it doesn’t unduly disrupt workflows for the others.

But I do think it could be worthwhile for Obsidian to provide some guidance up front on the overall strategies that each option supports or inhibits. And perhaps some guidance on common settings / plugins / themes to use for users who are switching from Noteplan, Bear, Roam, etc. to make the experience feel more like their prior app.

@greatqs

This can be done by the plugin
consistent-attachments-and-links

But if you use obsidian Sync now it does not work correctly with it - Obsidian Sync. Spontaneous deletion of pictures - #15 by friendlmickle.

I make issue - Обновление кеша ссылки - конфликтует с работой obsidian Sync · Issue #8 · derwish-pro/obsidian-consistent-attachments-and-links · GitHub and hope the developer will fix this soon. I like the plugin very much!

1 Like

@friendlmickle Hi, I just checked plugin github link but it seems there is no fix on the sync issue as you mentioned. Do you know whether this is currently any solution to have this attachment folder renaming feature while keeping compatible to native sync?

@greatqs Hi! No, I don’t know of such a solution. Unfortunately.

I think an obsidian native solution for moving attachments with notes would be really useful for a large group of users. The solution by @dy-sh is intelligent, but you also have to give up some Obsidian smartness.

It would be a great addition to Obsidian if a note could be moved to another folder and the attachments would keep their same relative position. In my case, I store attachments in an ‘assets’ subfolder of the folder in which the note resides. It would be great if, when I move a note to another folder, its attachments would move with it to the assets folders of that new folder.

14 Likes

would also love this feature

Z

This would be a really useful feature.

My note-taking is rather image heavy, so moving notes with lots of images, say from an inbox folder to its permanent filed location, can be quite tedious and error prone.

Often, I will quickly make a note in a default folder with the hotkey, add some text and images, then move the note to its propper location with the “Move current file to another folder” in the command palette.

It would be very useful if there was a second command in the palette, lets say “Move current file to another folder, and bring all linked images also in the same folder/attachment folder with it”.

The key here would be to avoid moving any attachments that are linked in that are already in their correct location in a different folder.

1 Like

+1 Follow

My use case: we share a knowledge base in our team using git. Most notes start out in a private folder, until they’re mature enough to be shared (i.e. moved to the general folder).
Most of our notes are using a number of images, which are automatically stored under an “attachments” subfolder of the current directory.

We want to be able to easily move notes/folders around in the vault, while keeping them portable as a unit (i.e. images are shared with the note when you e.g. zip a folder and send it to someone).

Currently we can easily move the “attachments” folder with the notes we move.

However, when there is e.g. 4 notes in a folder with images, and we want to move 1 note with its images. We need to start figuring out which images belong to which note.

Having 1 subfolder per note is not an option, that’s too cluttered.

In the meantime I will check out @friendlmickle 's suggestion (obsidian-consistent-attachments-and-links)

I think the plugin could do the following:

  • When moving a note, the setting 'Default location for new attachments` is honored, moving the attachments and creating a host directory if necessary.

If other notes point to the same attachments

A Modal is shown to confirm moving the attachments:


Do you also want to move the (5) attachments?

There are currently (2) links pointing to the attachments.

[ ] Don’t ask again [Move][Cancel]


I would personally click on don’t ask again.

2 Likes

Apple notes does this and it’s very confusing. If you drop a file or folder into a note it embeds it into the note (instead of linking to it). It’s one of the reasons I stopped using Apple Notes (along with it deleting two weeks of notes in an iCloud bug)

obsidian-attachment-management can be used as an alternative consistent-attachments-and-links (buggy)