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

Obsidian works with a vault associated with the file so there’s some extra work where the file system has to be parsed to find the hidden vault folder in order for the file to open. And MacOSX (or Windows AFAIK) does not have such support in its Open default settings.

Drag and drop might work if something like this is implemented. Or on the Mac, as Share extension, or Services system extension with keybindings could work.

1 Like

Default md viewer with the option to import into a vault :+1:

14 Likes

I"m looking for an option to import md files directly into Obsidian app. Is this the same as you’re requesting? Currently I just drag the files into the Obsidian directory and open from within.

Yeah, that would be a great expansion of what I am suggesting! A solution like the one @goodsignal proposed sounds great.

It would be nice to have the ability to right click a folder in explorer/finder and have a shortcut to open the folder with obsidian in the context menu.

2 Likes

I would find this functionality very useful too. My imagined use cases include:

  • As you mentioned, using Alfred to launch Obsidian directly to a document
  • I index my Obsidian Vault with DEVONthink. If I can set Obsidian as the default markdown editor, when I’m viewing Obsidian notes in DT, I can open it in Obsidian with a simple keyboard shortcut.

Great idea

1 Like

I’m not able to set Obsi as default app for opening markdown files (Mac OS). Can it be fixed or implemented…

It would be very helpful in my workflow involving indexed folders in Devonthink…
Cheers, a.

1 Like

I’ve try it but yes, it can not open a file from file explorer directly yet. Maybe you should try to create a vault which include obsidian file and Devonthink file as a temporary solution?

I noticed I cannot open .md files using Obsidian. My workflow consists of Alfred > filename.md . I havent seen this on the roadmap either.

I was looking for this too.

I would love this feature too.

  • Ability to set Obsidian as default app for opening .md files
  • If the .md file is already in one of Obsidian’s vaults, then Obsidian opens that file in that vault.
    • but if the file is not in one of Obsidian’s vaults then:
      1. obsidian simply opens the file as an editor (without graph, backlinks support etc.) and
      2. obsidian offers to import the file into the vault of your choice
5 Likes

Mostly reformulating the post above↑
Expected behavior when Obsidian is set as default app for “.md” files:

When Obsidian receives request to open “a/path/to/<filename.md>”,
Climb up the folder hierarchy and check for existence of sibling folder named “.obsidian”.
When found, open corresponding vault. This will find innermost vault when nested vaults are being used.

current_folder := "a/path/to" // path to file
Loop{
- If current_folder has direct subfolder ".obsidian": 
	- open obsidian://vault/<current_folder>/<filename.md>
	- return
- Else If current_folder has parent folder: 
	- current_folder := parent folder of current_folder
- Else: 
	- Display dialogue with options:
		- open just in markdown editor without vault (default)
		- select which folder from the path to transform into vault
		- move the file into existing vault
			- Display dialogue with options:
				- select one of existing vaults, recently open vault being default
				- cancel
					- return
		- cancel
			- return
}
5 Likes

This behavior would be perfect for Zotero integration with mdnotes – I could open the created .md file within Zotero and jump directly to the notes file in Obsidian. This would also enable the articles themselves to easily serve as “start” parts, which fits in nicely with Zettelkasten principles.

For now, I have to search twice – once in Zotero when finding the article, and another within Obsidian to search for the created .md file

I would also like to see this happen. Using Alfred and or Finder, even with the setting up to Obisian as the default app, no files will open.

1 Like

You might appreciate:

2 Likes

Thanks @ryanjamurphy I will have a look at that. Downloaded it on iOS and will check it out later. Hopefully I can understand it. :blush:

Just like mentioned above, I am still not able to open, edit, or create any note in Obsidian. The only place this can be done is directly within the vault in Obsidian.

I suspect the problem being the file path to iCloud Drive/Taio/Editor, where all the files exist. It is mandatory that they are there to have a workflow on iOS with Taio and Mac OS with Obsidian.

This is an ongoing problem. Egreg scripts also cannot find the path as well.

This may also he my own ignorance and if so, it would be wonderful if someone could point me in the right direction.

Thx.

No, Obsidian does not handle files the way other apps do. You cannot tell it to open arbitrary markdown files. You must open files from within your vaults. This thread represents the feature request for what you’re looking for, and it is not implemented yet.

The Alfred workflow I linked is a workaround another user created. It lets you search for and open files in your vaults from Alfred by taking advantage of Obsidian’s URL scheme. Once it’s configured, you can e.g., initiate a files search by typing oss (you can customize this command), then hitting enter, then typing your search query. The workflow will return matching notes/files in your vaults and upon selection will open those in Obsidian.

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.