How can I check if Obsidian is already running?

In some cases, the question might come up when a Shortcuts workflow "cold-starts" Obsidian. Depending on the size of your vault and the list of enabled plugins, Obsidian might need a second or more to get into a fully responsive state. Which might cause a problem when Actions For Obsidian runs a Shortcuts action, expecting Obsidian to be fully up, and that isn't the case — because the actions call might be handled before the vault is completely initialized, plugins and all.

This is more of an iOS problem than a macOS one due to processing power and Obsidian's base code on each platform.

On macOS, you can check if Obsidian is in the list returned by the "Get Running Apps" action (c/o Actions app by Sindre Sorhus) but usually that is unnecessary.

On iOS, it's impossible to check whether Obsidian is running, since iOS doesn't allow Shortcuts to query which apps are running. (If that statement is somehow incorrect, please let me know!)

A workaround here is to open Obsidian once at the beginning of the workflow and give it a moment before running any AFO actions. If the workflow you're building is supposed to run on both macOS and iOS, it's a good idea to check for the OS first:

  1. Add a built-in "If" action.
    1. Select "Device Details" as the input.
    2. Click "Device Details" it and pick its "OS" attribute from the list to make the check about the type of operating system.
    3. Select "is" as comparator and "iOS" as the condition.
  2. Add a built-in "Open app" action, select "Obsidian".
  3. Add a built-in "Wait" action, set the delay to whatever is necessary for your vault.
Screenshot of the "If OS is iOS" conditional in Shortcuts editor as described above

If the workflow is iOS only, ignore the "If" block and just add the latter two actions.

Thanks to Kenny M. for the suggestion! ✌🏼

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Carlo Contact Carlo