December 15, 2020

How to open Teams link directly in the client desktop app?

In this post I explain a trick how to open Microsoft Teams links directly in the Desktop Fat client without going through the browser.

Trick

To force opening a teams link/url in the Teams Client you simply can replace the https: protocol to msteams: protocol.

Implementation

Redirector

Based on previous trick you can for example use following Redirector rule to redirect teams link to the fat client:
teams_redirector_to_client.png

AutoHotkey / NWS PowerTool

Alternatively you can use a AutoHotkey script to trigger the direct opening in the app:

; Function OpenLink
; Open Link in Default browser
OpenLink(sURL) {
    If IsIELink(sURL) {
        ;Run, %A_ProgramFiles%\Internet Explorer\iexplore.exe %sURL%
        Run, iexplore.exe "%sURL%"
        ;Sleep 1000
        ;WinActivate, ahk_exe, iexplore.exe
    } Else If Confluence_IsUrl(sURL)  || Jira_IsUrl(sURL)  { ; JIRA or Confluence urls                          
        ;Run, C:\Users\%A_UserName%\AppData\Local\Google\Chrome\Application\chrome.exe %sURL%
        Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 3" "%sURL%"
    } Else If InStr(sURL,"https://teams.microsoft.com/") { ; Teams url=>open by default in App
        ;Run, StrReplace(sURL, "https://","msteams://")
        Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 4" "%sURL%"
    } Else {
        ;sURL := CleanUrl(sURL) ; No need to clean because handled by Redirector
        Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 1" "%sURL%"
    } ; End If
} ; End Function OpenLink

This is implemented in the NWS PowerTool (ahk/NWS.ahk->OpenLink) and will be triggered with a Shift+Mouse click or Middle Mouse button click.

No comments:

Post a Comment