# MAC: Opening specific Obsidian vault other than last open when app is not already open fails

**URL:** <https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927>\
**Category:** Bug graveyard\
**Tags:** upstream-bug, repro, macos\
**Created:** [October 31, 2020, 8:22am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927 "2020-10-31T08:22:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![borisanthony](https://forum.obsidian.md/user_avatar/forum.obsidian.md/borisanthony/32/2709_2.png) [@borisanthony](https://forum.obsidian.md/u/borisanthony)\
**Post date:** [October 31, 2020, 8:22am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/1 "2020-10-31T08:22:57Z")

</div>

### Steps to reproduce

- Have multiple Vaults. (“test1”, “test2”, “test3”)
- Open “test1”.
- Quit Obsidian.
- Execute obsidian://vault/test2 or any obsidian://open… (_make a test.html file somewhere with a link, open it in web browser and click link_).

### Expected result

Executing any obsidian://open command (including shorthands) when _Obsidian is not already open_ launches Obsidian and opens the requested Vault and/or File in that Vault.

### Actual result

Executing any obsidian://open command (including shorthands) when _Obsidian is not already open_ launches Obsidian and if the last “top” open Vault is not the same as the Vault/File being requested, only the last “top” open Vault is opened, and nothing else.  
I.e.: Obsidian is opened in it’s last state before being closed and the requested Vault/File—which is different from the last open Vault—is not opened. The request is effectively ignored or fails.

### Environment

- Operating system: macOS Catalina 10.15.7
- Obsidian version: 0.9.10

* * *

### Additional information

- The “open” state of Obsidian seems to require a vault to be loaded.
- Closing all vaults exits the app. Last closed vault is perhaps saved as “default” or “last known top state” or something?
-

---

<div class="post-metadata">

**Author:** ![borisanthony](https://forum.obsidian.md/user_avatar/forum.obsidian.md/borisanthony/32/2709_2.png) [@borisanthony](https://forum.obsidian.md/u/borisanthony)\
**Post date:** [October 31, 2020, 2:15pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/2 "2020-10-31T14:15:56Z")

</div>

I see someone else has bumped into this and “it is a known bug of Electron apps”:

> **[hauselin/obsidian-alfred](https://github.com/hauselin/obsidian-alfred)**
>
> Alfred workflow for Obsidian note-taking app. Open vaults and files in Obsidian. - hauselin/obsidian-alfred

> **[Discord - A New Way to Chat with Friends & Communities](https://discord.com/channels/686053708261228577/716028884885307432/755203478413902036)**
>
> Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 31, 2020, 2:39pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/3 "2020-10-31T14:39:57Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![rigmarole](https://forum.obsidian.md/user_avatar/forum.obsidian.md/rigmarole/32/29973_2.png) [@rigmarole](https://forum.obsidian.md/u/rigmarole)\
**Post date:** [October 31, 2020, 8:54pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/4 "2020-10-31T20:54:49Z")

</div>

### Steps to reproduce

1. Let’s say I have 2 vaults. **VaultA** and **VaultB**.

2. I close VaultB. I then close VaultA last. **VaultA** is the last-closed vault.

3. I have 4 test urls to open either the vault or a specific note:  
obsidian://open?vault=VaultA  
obsidian://open?vault=VaultB  
obsidian://open?vault=VaultA&file=Test.md  
obsidian://open?vault=VaultB&file=Test.md

4. If Obsidian is closed, clicking any of those urls will open the last-opened **VaultA** , and the last-opened note, and ignore anything in the url.

### Expected result

The specified vault and/or note should open.

### Actual result

If the Obsidian app is **closed** , clicking any of these links will open the last-opened vault and the last-opened note.

If Obsidian is already **open** , the specific vault or the specific note in the URL does open as expected.

### Environment

- Operating system: MacOS
- Obsidian version: 0.9.10

* * *

### Additional information

---

<div class="post-metadata">

**Author:** ![xurc](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/x/c4cdca/32.png) [@xurc](https://forum.obsidian.md/u/xurc)\
**Post date:** [November 1, 2020, 1:10am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/5 "2020-11-01T01:10:04Z")

</div>

I _think_ it’s a limitation of Electron. Related:

> [@Close obsidian window with cmd w on mac. Leave app running for faster launch](https://forum.obsidian.md/t/close-obsidian-window-with-cmd-w-on-mac-leave-app-running-for-faster-launch/3552/8):
>
> Besides faster launching, there’s another reason this feature matters: when Obsidian is not running in the background, launching an Obsidian URL will not take you to the corresponding note. I think there was a discussion in discord about this behavior and turns out it’s a limitation of Electron. I’d like to leave Obsidian running 24/7 on my Mac because the URL scheme doesn’t work properly otherwise.

---

<div class="post-metadata">

**Author:** ![borisanthony](https://forum.obsidian.md/user_avatar/forum.obsidian.md/borisanthony/32/2709_2.png) [@borisanthony](https://forum.obsidian.md/u/borisanthony)\
**Post date:** [November 1, 2020, 12:08pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/6 "2020-11-01T12:08:40Z")

</div>

One workaround, on Mac at least, is to use AppleScript applets to a) launch Obsidian and then b) invoke any obsidian:// URL command (open Vault, etc…)  
(_This will open whatever the last open Vault was first. No way around that I suppose._)

AppleScript code example:

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

```

AppleScript can be invoked as little applets (use the “Script Editor” to make these), or as scripts via the Terminal (osascript /path/to/script). Raw AppleScript code can also be executed this way via Terminal, and any scripting language that supports calling osascript (shell, Python)

This is good enough for me, and opens other doors for exploration.

Cheers.

---

<div class="post-metadata">

**Author:** ![nickwarters](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nickwarters/32/1277_2.png) [@nickwarters](https://forum.obsidian.md/u/nickwarters)\
**Post date:** [January 3, 2021, 12:00am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/7 "2021-01-03T00:00:31Z")

</div>

### Steps to reproduce

When using the URL Scheme to open a specific note, it will only work if Obsidian is already open. If obsidian is not currently running, opening the URL will open Obsidian, but not the specific note passed in with the URL.

If Obsidian is currently open, running the exact same URL again will cause the required note to open.

### Expected result

Obsidian should open to the specified note.

### Actual result

Obsidian opens but does not open the specified note.

### Environment

- Operating system: Mac OS Big Sur 11.0.1

- Obsidian version: 0.10.5

* * *

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 10, 2021, 1:44am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/8 "2021-04-10T01:44:37Z")

</div>

Is this still happening?

---

<div class="post-metadata">

**Author:** ![luckman212](https://forum.obsidian.md/user_avatar/forum.obsidian.md/luckman212/32/3445_2.png) [@luckman212](https://forum.obsidian.md/u/luckman212)\
**Post date:** [April 10, 2021, 1:55am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/9 "2021-04-10T01:55:27Z")

</div>

@WhiteNoise When did this get fixed? I was having this problem too, but I just tested it now and can’t reproduce on 0.11.13 so it seems good now.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 10, 2021, 1:56am UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/10 "2021-04-10T01:56:19Z")

</div>

this was an electron problem not ours.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [April 11, 2021, 1:03pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/11 "2021-04-11T13:03:24Z")

</div>

Closed on April 11, 2021, 1:03pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 13, 2022, 4:10pm UTC](https://forum.obsidian.md/t/mac-opening-specific-obsidian-vault-other-than-last-open-when-app-is-not-already-open-fails/7927/12 "2022-10-13T16:10:25Z")

</div>

Archived on October 13, 2022, 4:10pm UTC


