How to open existing txt files with Obsidian when I doubleclick them on my desktop

What I’m trying to do

I’ve already set my default text editor software to Obsidian by right clicking the text file and clicking
Open With → Choose another app.

For some reason, every time I open the text file, it either takes my to my existing vault without opening the text file at all, or it takes me to this screen.

I feel like everything I’ve clicked on that screen never actually leads to the text file being opened within Obsidian. There has to be some sort of setting to fix this – I saw other posts recommending plugins, but I didn’t understand why a text editor software would need plugins to open a plaintext file?

Please let me know what I’m missing. Sorry for the trouble.

Obsidian is different from other Markdown or code editors that can open and edit different kinds of files from pretty much anywhere. Obsidian works on files already in a “vault” (just a local folder on disk); you interact with those notes (.md files) within Obsidian. All the notes, images, PDFs, and other accepted file formats need to be in your vault for Obsidian to work properly.

It’s surprising that you were able to set the default app to Obsidian for .txt files. Windows and macOS make it a bit difficult to do that (last time I checked). I’d use Notepad++, Sublime Text, etc., for this.

If you have a lot of existing .txt files, you can convert them to .md files, and drag them into your vault folder so that you can use them in Obsidian. To add items into your vault you can use Windows Files Explorer or the Finder outside of Obsidian to move them, or drag the files onto the vault name at the top of Obsidian’s Files tab.

However, there are a few community plugins that can view .txt files that are in your vault, but I would get into the habit of using .md files from here on out.

You can’t open files in Obsidian that way, even if they’re in an Obsidian vault.

You could perhaps setup some kind of script that converts the file path to an Obsidian URI (see Help about URIs) and open the files with that (if they’re in a vault).

Are you familiar with Autohotkey? I’ve recently gotten a hotkey working that will open files in Obsidian by first selecting the file (clicking once, not twice), then pressing the hotkey.

If you work with multiple vaults, you could set up one hotkey for each vault.

Here’s the Autohotkey forum topic where I explain how it works: Opening files in Obsidian, the Markdown program, with a hotkey - AutoHotkey Community

And here is the script; you would just need to modify it to list the path to your own vault, specify the name of your own vault, and specify a different hotkey if you don’t like Ctrl-0:

#IfWinActive ahk_exe Explorer.exe
; opens a selected file with Obsidian
^0:: ; ctrl+0
Clipboard =
Send ^c
ClipWait ; waits for the clipboard to have content
Clipboard := StrReplace(Clipboard, " ", "%20") ; replaces spaces with "%20" as per Obsidian's specification
Clipboard := StrReplace(Clipboard, "C:\Users\me\Desktop\", "") ; enter your own path to your Obsidian vault here
Run, obsidian://open?vault=Desktop&file="%clipboard%"
Return

I had used below plugin and was able to open text files.

seems like it is removed now, but it mentions a new plugin in it’s readme. So maybe that will work. I am yet to try that.

Update: Just tried below plugin. It works

Note that the file should be inside your obsidian vault. You can browse for the file in the sidebar and then double click to view it.

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