Mac: Opening Notion/Linear links in the right app

The two (web) apps I use the most in my day-to-day Prezly work are Notion and Linear. I do prefer their native (Electron based) apps.

Using BetterTouchTool and the Hyper-key I have dedicated keys to switch to those apps. In my case Hyper+L opens Linear where Hyper+N switches to Notion.

But as both apps link to each other a lot and we share a lot of Linear and Notion links through email, slack or other messaging apps they always open in my browser.

BTT to the rescue

I have configured BTT (BetterTouchTool) as my default browser and set up some automation to inspect the URL and launch them in the right browser before falling back to my default browser.

Configuration in BTT
Configuration in BTT

And then I'm using Javascript to launch the right app and pass the URL.

This set-up works pretty well. It does not work within the browser though. So if you're clicking Notion/Linear links from a webpage (already in the browser) this automation does not kick in as it does not pass through the OS link handling.