Create subfolders for attachments based on custom pattern (e.g. note file name)

In Typora it is possible to automatically create subfolders with custom patterns when adding attachments, or for example when dragging and dropping an image into the markdown file.

When this is done, the image is added to an automatically created folder placed at the same root of the markdown file.

This is done in Typora settings by specifying the following as attachments folder:

./${filename}.assets

So, for example, when dragging and dropping an image to the XXX.md file, this will be the file structure:

XXX.md
XXX.assets\attachment.bmp

Is something like that achievable in Obsidian?

More in general, what are the variables available to be used as custom pattern other than filename?

Best regards

I found this plugin which is working well by replicating Typora behaviour:

The core settings are also configurable to: this file’s folder.

Angel

1 Like

Thanks @Angel, but by following your solution the attachments of multiple notes stored in the same folder would be created in the same subfolder, which is a behaviour I wanted to avoid (I don’t want to mix attachments of multiple notes storing those attachments in a single folder).

With my solution, each note (i.e. file) will get a private subfolder containing all of its attachments.