Have Obsidian be the handler of .md files / Add ability to use Obsidian as a markdown editor on files outside vault (file association)

Thank you for clearing up the open files from within finder Feature Request @ryanjamurphy

I do greatly appreciate all your involvement and trying to help. The roadblock I came across with the Alfred Workflow is the current root path of Mobile iCloud folders, at least in my learning mind thinks that is the problem. I have not found a way to set the path in Alfred to correspond and directly link to the proper folder.

This is all a learning experience for me and I perhaps don’t know the proper procedure.

The Alfred workflow can figure that out for you.

Use the prompt oaddvault and search for the folder name of your vault. It will pick up the path contained in the iCloud directory and add the vault to the workflow’s config.

Thx @ryanjamurphy I have did that dozens of times and without good results.

I can get the Alfred Workflow to recognize the root folder and add a daily note. The problem, I have folders and subfolders in the root directory and it doesn’t seem to recognize them. Example:

~icloud Drive/Taio/Editor is found and will add daily notes there.

However, from there, there are many folders and subfolders, i.e.:

~iCloud Drive/Taio/Editor/Inbox

I am sure I am still doing something wrong. Thus all still a learning process for me.

Hm. Not sure what’s going on, but the developer of the workflow is pretty responsive. Maybe create an Issue on the GitHub page I linked above?

Ok. Thx for all your trouble.

Related to this: Open and edit standalone Markdown files

+1 this feature. It’s very important to me.

I want to be able to use the Mac Finder and search tools to locate documents within the Obsidian vault, and open them from within Obsidian. I don’t really care about using Obsidian to open Markdown files outside the Obsidian vault.

I think of it is a way to enter the Obsidian vault through any document, not just the daily note or whatever document happened to be left open when I last used Obsidian. Very useful!

And thanks to @ryanjamurphy for the pointer to the Obsidian workflow. That gets me off to a good start on the functionality I seek — but only a start!

2 Likes

+1 for having Obsidian being the default markdown editor (on mac). Right now, when I do set it as the default editor, Obsidian opens, but the file itself is not opened. Thanks.

3 Likes

Hi everyone! I’m extremely new in here and with Obsidian, but I think this is the right place for my doubt, please bear with me.

Is this the expected behavior?:
I’m on Windows10, I want to open an md file which is already in my vault, I select it on the file explorer or by searching with “voidtools’ Everything” and click “open with / obsidian”. Obsidian launches, but it shows me a screen where I can open or create a vault.

I know it wasn’t going to open the file, but the vault screen puzzled me.

Anyway, count me in the feature request for Windows!.

Yes it’s expected.
Obsidian works on top of a folder of .md files. It knows nothing about files unless Obsidian is open, and then only about the files in the open vaults. It’s frustrating if you want to open a file in Obsidian from operating system, but that’s the way it works.
If you only want to edit a file and don’t need Obsidian specific features, then you can open it in another editor without impacting Obsidian or its access to the file.

1 Like

Understood, thanks a lot for your reply.
But I really hope this gets changed.

For a PC, all you have to do is right click any .md file, select Properties, and then click the Change association button, and select whatever app you want. There is also a general files association area in newer versions of Windows.

Surprises me what Mac folks have to go through to control simple OS aspects.

The steps to change a file extension association on macOS are pretty much the same as on Windows. The issue is that markdown files cannot be arbitrarily opened by Obsidian, even if the files are already notes in a vault.

Default md viewer with the option to import into a vault … this is needed.

1 Like

Yeah this is a really important issue for me. I’d like to be able to view all my files like normal and not have to use a separate md editor to open a single file i want to look at if im not in obsidian. Obsidian as a file explorer is simply not very good and I’ve looked for every alternative. Because of this, a possible solution for me is just being able to use my file explorer as normal. At this point, I’m just using a different md editor so I can open a single file. It would be nice to have consistency in functionality for md as well as appearance.

The problem is this issue. I’d like to be able to use only one md editor and have md files open with obsidian as default. Currently, it either asks which vault i want to open, or just opens obsidian and goes to the last file I was on. I’m on windows.

I’m not a programmer so I don’t know the reasons why this isn’t possible like in other md apps, but perhaps a possible solution is to have a separate program (it could be in the same obsidian.exe if possible…) Like Obsidian viewer or obsidian editor? And all it would do is open that md file and let you edit it with the same settings as your vault if it’s in that vault? Or the preferences for the obsidian editor could be separate like a separate vault. This “Obsidian viewer/editor” could have different functionality that maybe it’s difficult to have in the base program ( I dont know im not a programmer) But stuff like printing, print preview, in a much easier way.

Of course, having obsidian be a better file explorer with keyboard functionality and better view would work as well. Then I wouldn’t need to use the file explorer. But it’s annoying how obsidian doesn’t seem to have any priority to make it better for exploring files and I’m not allowed to open md files with obsidian in the file explorer. This issue has been frustrating me for days and I’ve been trying to find a work around because I don’t want to use multiple programs.

Hopefully this can be seen as a somewhat important issue. Either improving the file exploration in the program itself or allow us to use obsidian as an md editor. The whole purpose of obisidian is to let you own your files, so I think it would be really great if we could have that freedom!

2 Likes

I doubt this will happen. At the very least it would require a major rewrite, and many functions would not be available because they are vault dependent. Even the CSS is vault based. And user preferences. Assuming it is possible at all.
A standalone editor would be possible, but offer no real advantages over the other programs available now, and would consume some developer time that most users would probably prefer goes into the main program. The printing and preview would be no easier.

I’m sure the file explorer will be developed further at some point. But major changes seem unlikely to be anytime soon - it’s not on the long-term road map and features that are already are likely to be very time-consuming.

Joining the feature request as this is a really important element in allowing more workflows which is what obsidian is all about. Someone mentioned that you’ll need a rewrite for this? That sound really incorrect, the solution shouldn’t be complicated or difficult. If the item is in an exsisting vault open it inside of it. If not in a ghost vault.

Ghost vault options

  • Just a default vault centered on the current folder where any settings or customization is either
    • Grayed out
    • Going to create a new .obsidian folder ie create a new vault in current folder
3 Likes

In case it’s still relevant, I made a Zotero add-on that lets you open existing Obsidian notes for items in Zotero: ZoteroObsidianCitations . It also adds a tag to the corresponding items in your Zotero database, which you can color so that Zotero items associated with MD notes are visible at a glance.

ZoteroObsidianCitationsMenu

1 Like

Of course, having obsidian be a better file explorer with keyboard functionality and better view would work as well. Then I wouldn’t need to use the file explorer.

The Quick Explorer plugin makes it easier to browse and preview in Obsidian using the keyboard. It’s not as good as Windows’ own explorer, but I created it because of the same frustration

I’m not allowed to open md files with obsidian in the file explorer.

You can drag and drop them into Obsidian and then open them, but that’s probably not what you want, as it’ll make a copy – even if the file was already in your vault! (I’d love to see Obsidian check whether dropped files are already in the vault, and if so, not import a new copy, as it would make for better interop with both File Explorer and NotebooksApp.)

I personally use Typora for non-vault files, but for File Explorer integration I do have a Windows Script Host script registered as a menu item for .md files, that converts the file path into a URL and opens it in Obsidian. (Assuming it’s under a vault.) The script is in Python, and looks roughly like this:

#!cscript
import os, urllib
(filename,) = list(WScript.Arguments)
os.startfile(
    "obsidian://open?path=" + urllib.quote(filename)
)

This will only open markdown files that are within some Obsidian vault, however. If it’s not in a vault you’ll get an error message. The registry entries I used to enable it were:

[HKEY_CLASSES_ROOT\Applications\Typora.exe\shell\open_with_obsidian]
@="Open with Obsidi&an"
"Icon"="C:\\Users\\pje\\AppData\\Local\\Obsidian\\Obsidian.exe"

[HKEY_CLASSES_ROOT\Applications\Typora.exe\shell\open_with_obsidian\command]
@="C:\\Windows\\SysWOW64\\wscript.exe \"E:\\Users\\pje\\cyghome\\DSI\\automata\\Open_In_Obsidian.pys\" \"%1\""

But please don’t ask me for help on adapting this to your system, because I honestly don’t know for sure how I set WSH up to begin with nor am I even certain what version of Python was used (though it’s probably in the 2.5-2.7 range). It’s been a decade minimum since I first set up the Windows Script Host stuff and haven’t touched it much since. (Also, the registry entry for Typora.exe is obviously not what you’d change if that’s not your system-default markdown editor!)

2 Likes