Drag and Drop external Link not working in live preview mode on mac

Steps to reproduce

In live preview edit mode, drag a file from finder over a note and hold control and drop onto the note

Expected result

It should create an external link with the absolute path of the file

Actual result

No link is generated and the file animates back to the finder

Environment

  • Operating system: MacOS Monterey 12.1
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.13.19
    Installer version: v0.13.19
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: light
    Community theme: Atom
    Snippets enabled: 0
    Safe mode: off
    Plugins installed: 0
    Plugins enabled: 0

RECOMMENDATIONS:
Custom theme: for cosmetic issues, please try to make the issue happen in the help vault or disable community theme and snippets.


Additional information

1 Like

Please, post a screen recording of this happening in the help vault.

Here is a screen recording of the issue in action

I don’t recall if on Mac you are supposed to use Cmd-drop

I tried command drop as well with the same result

thanks, it’s actually ctrl. we’ll look into this.

does it work in source mode?

Not in my tests…

Angel

I have the same problem in almost the same setup. As I use this function quite a lot, I had to come up with a quick and temporary solution.

I made a new Automator’s “Quick Action” with the name “Obsidian Path”. This automation runs an AppleScript to copy to my clipboard the necessary [Name](path) string.

Here is the Automatomation in Automator:

Don’t forget to set “Workflow receives current → Files or folders in → Finder.app”

Here is the code for the Applescript inside:

 on run {input, parameters}
	set theseFinderItems to {}
	repeat with aItem in input
		copy quoted form of POSIX path of aItem to end of theseFinderItems
		copy space to end of theseFinderItems
		set textTemp to first item of theseFinderItems
		set my text item delimiters to ":"
		set theResults to aItem as alias as string
		set nameTemp to the last item of text items of theResults
		set the clipboard to "[" & nameTemp & "](<file://" & textTemp & ">)"
	end repeat
end run

When I want to copy a path from Finder, I just do:
Right click on file → Quick Actions → Obsidian path

Screen Shot 2022-01-29 at 12.04.17

And then go to paste it to Obsidian.

I might keep using this Quick Action, as it gives the path between < > , so it doesn’t need to scape spaces, and it is so much cleaner.

Hope it helps
Marco

Thanks for the detailed information. This looks like a nice workaround. I’ll give it a shot. Still hoping for the real fix at some point.

Filenames with spaces were not working properly so I made a change that seems to have fixed it.

on run {input, parameters}
	set theseFinderItems to {}
	repeat with aItem in input
		copy POSIX path of aItem to end of theseFinderItems
		copy space to end of theseFinderItems
		set textTemp to first item of theseFinderItems
		set my text item delimiters to ":"
		set theResults to aItem as alias as string
		set nameTemp to the last item of text items of theResults
		set the clipboard to "[" & nameTemp & "](<file:/" & replaceChars(textTemp, " ", "%20") & ">)"
	end repeat
end run

on replaceChars(aString, charToReplace, newChar)
	set {TID, text item delimiters} to {text item delimiters, charToReplace}
	set aString to text items of aString
	set text item delimiters to newChar
	set aString to aString as text
	set text item delimiters to TID
	return aString
end replaceChars

we are gonna move to alt-drop for osx.

Will be fixed 0.13.29.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.