Open specific vault from Finder

I have several vaults.

I want to open a specific vault (via Finder/etc) without having to

  • open Obsidian,
  • select “Open another vault”
  • select vault to open

(I also run several markdown editors and Obsidian is not, and will likely never be, my default markdown editor.)

Perhaps the simplest solution from the product side is a way to save vault shortcuts to the Finder.

I am currently trying to figure out a way fake this with shell script, AppleScript, anything… but am bumping into issues (Currently, only way to send commands to Obsidian from “outside” seems to be URL Schema, and obsidian://vault/VaultName is acting funky. Will try to file a bug report.)

Related, perhaps: Obsidian as default app .md viewer

Not quite. :slight_smile:
I want to open a Vault, not a File/Note.
And as stated I do not want to set Obsidian as my default markdown app.

In MacOS you can save a URL as a file. Then if you launch it in Finder, it will open the vault/note. So you could create links to each of your vaults.

I just dragged an Obsidian url from Firefox onto Finder. I don’t know if there other ways. This is the contents of MyFancyVault.inetloc so you could just make the file in a text editor.

My vault name is “ObsidianNotes”

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>URL</key>
	<string>obsidian://open?vault=ObsidianNotes</string>
</dict>
</plist>

EDIT: There does seem to be a bug though… If Obsidian is closed, using the url, my last-opened vault opens. If Obsidian is already open, THEN it opens whatever url I clicked on. Which is also the case if you simply click on a link.

I filed a bug here.

2 Likes

Thanks yes I filed the same bug yesterday here:

and @WhiteNoise Split/Merged yours and mine.

It seems to be a limitation of Electron apps. So the question is:

  • is it solvable? i.e.: is it something that can be filed as a bug on Electron and reasonably expect a fix?
    or
  • is the only solution (for now, yes) to keep Obsidian open?

BTW:
I have found a cringe-y workaround using AppleScript: Create an AppleScript “app” for each Vault, which first tells Obsidian to Launch and then tells Obsidian to open the Vault you want.
If I go this way I’ll share the AppleScript code here. :+1:t3:

Ok so yes, the following AppleScipt works.
First it launches (“Activate”) Obsidian (which will open whatever previous vault was the last to close I believe).
Then it instructs Obsidian to open whatever obsidian:// URL you pass it (this is actually VERY interesting in itself).

The AppleScript code:

tell application "Obsidian" to activate
tell application "Obsidian" to open location "obsidian://vault/Vault"

I imagine this works with any URL Schema URI. Which is very interesting (since for example you can execute AppleScript via Terminal (and thus shell script, Python, etc…) using “osascript”.

:+1:t3:

2 Likes