3

I have 2 Telegram clients on my MacBook

enter image description here

^ /Applications/Telegram.app/Contents/MacOS/Telegram

enter image description here

^ /Applications/Telegram.localized/Telegram.app/Contents/MacOS

Currently when I click a link, the first one opens. How to have the second one open instead?

EDIT: By removing the .app for the first one (Telegram Desktop) from my /Applications folder, links now correctly open in the second one.

However as soon as I restore it, links again open in it. Even changing the filename and moving it from /Applications to ~/Desktop, macOS still manages to find it when I hit ENTER on a link in Chrome.

enter image description here

How to prevent this behaviour?

Moreover can anyone shed some light on how macOS is able to track the movement of an app to any location on my filesystem in this manner?

P i
  • 1,745
  • 1
    Maybe try uninstalling and reinstalling the first client? That way, the database of protocols updates, so t.me is associated with the 2nd telegram. – anonymousaga Sep 10 '21 at 12:28

2 Answers2

4

t.me page tries to open the URL with tg:// protocol. You need to change the protocol handler for the same.

See https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x/548122

In the following file, find the item with LSHandlerURLScheme as tg and change its LSHandlerRole to what your intended Telegram's Info.plist specifies.

~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist
anki
  • 11,753
2

You can probably changed the protocol handler for tg:// using SwitftDefaultApps, which can be downloaded from here, or installed via Homebrew:

brew install --cask swiftdefaultappsprefpane

Then, simply go into the "URI Schemes" tab, locate tg://, and change the viewer to be what you desire. If the application you want does not show up, select "Other", then navigate to the desired app path using the cmd+shift+g shortcut to open the "Go to Folder" feature within the selection window.

dronenb
  • 527