Copy file to clipboard

Apologies if this has been covered before but I couldn’t find any posts discussing it.

How can I quickly and easily copy an item (NOT an item link) to clipboard so that I can paste it anywhere (email, WhatsApp chat, etc)? I tried a few basic Applescripts but none seem to work.

tell application id "DNtp"
	set thisRecord to item 1 of (selection as list)
	set filePath to path of thisRecord
	set theFile to POSIX file filePath as alias
	tell application "Finder"
		set the clipboard to {theFile}
	end tell
end tell

I use standard macOS features … select the item, cmd-C to copy to clipboard, move to other app that accepts clipboard stuff, cmd-V. Or perhaps quicker (or not, based on personal preference), “drag and drop”.

1 Like

I’d suppose that you can’t set the clipboard to a file. Either a file name or the content of a file.

cmd-C / cmd-V also sometimes copies the content of a file rather then the file itself for some reason.

Perhaps depends on where you paste into and what that “container” expects.

DEVONthink provides all kinds of formats (also during drag & drop), it’s up to the receiver to used the most suitable one.

Why copy and paste versus drag and drop?

I often use Yoink for this, especially when I have lots of windows open.

3 Likes