I am trying to change the default behaviour for when I drag and drop a file onto an Obsidian note from my computer. Specifically, I would like for new files to be inserted as text links rather than embeds.
Currently, when I drag a file from my computer onto a note, a few things happen:
The file is treated as an attachment and copied into an Attachments subdirectory of the current folder.
In my document, a link is generated of the format: ![[filename.pdf]] (the exclamation mark triggering the live preview/embed).
I would like the file to be moved into the Attachments subdirectory but for the link instead to be generated as [filename](filename.pdf) (no exclamation mark, and placeholder text for display).
Things I have tried
I have tried searching the forum and the community packages for something that would accomplish this but have been unable to find anything yet.
I think achieving it would be very difficult. Your question is very specific meaning you have to use some of the power plugins that can do many things.
If you can for example retrieve file path from {{clipboard}} then you can use other shell commands to move files to your vault and then return the customized link.
Thanks for the ideas! I honestly didn’t realize it would be this complex of an ask. While it isn’t exactly what I was hoping for (really wanted just to be able to drag and drop the file in without the ! mark), I’ve found a decent workaround is to switch to the Source Editing View prior to pulling the file in, which allows me to delete the exclamation mark without having to navigate around the embed preview.