Obsidian becomes the active/focus window when Actions-URI links are called

I read the message from Aug 2023 where the Actions For Obsidian window was gaining the focus at the end of a shortcut run. This isn’t that, though I realize it may be the same answer. It would be nice to know.

When a Shortcut completes and adds information to a note, the Obsidian app itself becomes the focused app. This happens when the “obsidian://” URIs are called from the Shortcut, or directly, via golang code for example.

Most of my shortcut calls are adding data to an existing note where I want to note something for reference AND I want to continue working in the app that had the focus when I triggered the shortcut.

So far, my only complaint. You don’t come across apps that are this useful very often. Hammerspoon, Obsidian itself, Beyond Compare, and this. Thanks for the fantastic tool!

~cj

An update, I found this post on the Obsidian forum: Leave Obsidian in background when making URI call? - Developers: Plugin & API - Obsidian Forum, and it turns out I was using a golang package that was basically making an OS level call to open, so I added the --background parameter to my call and I was in business. Likely you are doing more complex things, calling OS level APIs rather than using open on MacOS. Though hopefully this could be a future setting.

Hi @Christopher_Maahs, thanks for the kind words and welcome to the forum! I appreciate the follow-up, too.

When a Shortcut completes and adds information to a note, the Obsidian app itself becomes the focused app. This happens when the “obsidian://” URIs are called from the Shortcut, or directly, via golang code for example.

You have more leeway when sending the URL via scripts or from the terminal, but in iOS/macOS apps that need to go through App Store review, you can only pass the obsidian:// URL to the OS which will then decide what to do with it.[1] I’ve followed up on various ideas to make the whole process smoother but what we have now is the best I can do.

There are ways for apps like AFO and Obsidian to communicate in the background – but it’d involve both apps to permit each other to do that; I’ve asked Obsidian (the company) but they’re not interested in that. So that’s where we are.


  1. To the best of my knowledge. I might be wrong. ↩︎

Make sense, and I figured something like that was the case. Certainly just an annoyance. Plus, while I was composing this reply, I was able to work around by switching to a call to my golang cli for those times in which I want to add data to the note and not have Obsidian pop to the foreground. This worked perfectly.

1 Like