Have Obsidian be the handler of .md files (file association)

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
2 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
}
3 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.

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.

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