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.
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.
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
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.
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