I want to open a specific vault (via Finder/etc) without having to
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.)
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.
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?
is the only solution (for now, yes) to keep Obsidian open?
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.
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”.