How to paste attachments on MacOS

I tried to attach file to my note (format .pcap). If I paste the file, only the name of the file is pasted.
If I drag-and-drop the file is copied to the attachments folder and link is created.
I would like to see the same behavior when pasting files (I work in full screen mode and dragging files is very inconvenience), is it possible?

1 Like

Have you tried pasting with ctrl + shift + v?

1 Like

command+shift+v gives the same effect - only name of the file
ctrl+shift+v - nothing happens

I can confirm that pasting a file only pastes the name. And this is one of the several reasons I really don’t like the way MacOS handles full-screen as a separate desktop.

If you’re technically minded, as a hack/workaround, one thing you could consider is making an Alfred workflow, or an AppleScript workflow that copied the file to your attachments folder, and then copied the Markdown link text to your clipboard to paste into Obsidian.

I did a similar workflow like that long ago when I was writing Markdown articles before Obsidian came along.

This doesn’t do what you asked. It is just for ideas. This was a command I wrote for the Terminal to put in my ~/.bash_profile, if you are comfortable with command line tools at all. pbcopy is a command that captures text or information to your clipboard.

Otherwise I’m sure you could find similar functions in Alfred or AppleScript.

function aimg() {
	# aimg short for Attach Image
	# I use this for inserting screenshots in my Markdown documents
	# takes an argument OR asks for input. Your input becomes the image name
	# The the screenshot tool is activated
	# Then the image gets output to a directory
	# AND the Markdown syntax gets copied to clipboard, ready to be inserted into a document
	local IMGPATH="/Users/chrislesage/projects/attachments/"
	if [ $# -eq 0 ]
	  then
		printf "Enter image name  -> "
		read NAME
	  else
		local NAME=$1
	fi
	echo "Now take a screenshot"
	screencapture -i -t png -x -r "$IMGPATH$NAME.png"
	echo "image saved to:"
	echo "$IMGPATH$NAME.png"
	printf "![](file://$IMGPATH$NAME.png)" | pbcopy
	echo "Markdown syntax:"
	echo "![](file://$IMGPATH$NAME.png)"
}
1 Like

I also work in fullscreen on macOS Big Sur. Drag and drop works for me. Here’s my method:

Click the file in the finder and start the drag.
While still “holding” the file, press ⌘-⇥ (command tab) to switch to Obsidian.
Complete your drag and drop.

2 Likes

Thank you for your workarounds, will try both!

But, don’t you think it’s the issue/bug of Obsidian? If it works on Windows and Linux, why is it not working on Mac?

@Desmas it depends on what you’re referring to. I can confirm that currently pasting from the system explorer pastes the path only. This is due to how chrome handles the content it’s trying to paste. For now only drag and drop will get you the behaviour you want (the file added as an attachment).

I am referring to obsidian documentation that says that copy paste should work.

https://publish.obsidian.md/help/How+to/Manage+attachments

Pasting a local file from your system explorer or your clipboard will put the file into your vault.

1 Like

Good call. Perhaps the documentation should be updated, or a bug should be fixed. I vaguely seem to recall that pasting files used to work. But I’m not sure.

However, as described in the docs, if this was fixed, it would still only potentially work for supported file types. So it still might not work for pcap files.

Copy pasting supported files from Finder doesn’t work too