Safari: Share to Telegram

Hi , I am running KM 8.2.4 on macOS Mojave 10.14.4 and have created a macro group for sharing from Safari to e-mail, messages, etc. (so that I don't have to go through the Safari menu but can use a palette trigger instead). However, some apps do not have extensions so that they do not appear in the Safari menu under File -> Share and I cannot use the "select or show menu item" in KM. One of these is the messenger app Telegram, for which I would like to create a Macro, too. Telegram itself also does not have a "new message" item somewhere in its ribbon, so that I can't use that either. I have come up with the following provisional but rather messy solution, in which I use keystrokes to get the URL , insert text in order to type in the name of the contact I would like to send it to, and then the URL is pasted into the chat upon hitting return. It does not work, however, since when I run the macro a second time, Telegram will open to the last active search / chat, and hence cmd + F will search within that chat (instead of among all my chats). I tried to delete the current selection with cmd+A and delete , but that doesn't seem to be working... Any advice would be much appreciated

Keyboard Maestro 8.2.4 “Telegram” Macro

Telegram.kmmacros (6.7 KB)

I try to help people even when it's not easy. In this case you have the app Telegram and I don't, so it's not easy for me to help.

I think there must be a correct answer, but I'm unable to figure out the correct answer since I don't have that app. But I might have an ugly workaround. You said this macro works the first time but not the second time. I presume you mean the first time you run it on the app since the app started. So the obvious workaround seems to be that you should close and reopen the app from within your KM macro. That way each attempt to use the app is the "first time".

I know this isn't the best answer. But it might work. Just insert an action to close the app before you attempt to activate it. And give it a chance to close, either with a Pause Until or something equivalent.

If you don't like this answer, or if it really doesn't work, feel free to say so. That way someone better than me is more likely to chime in to try to get you the correct answer.

Hi @larilela, if you use the Telegram Desktop app from the Mac App Store, you would have an extension in the Safari menu. Or don't you want to use it?

Hey, thanks for both of your help/ advice. I use the "Telegram desktop" app from the App store (and for that one there is no extension in Safari) but this seems to be their cross-platform version and there seems to be another one in the app store which is just called "Telegram". And there you have the extension! So I just switched to that one for now - thanks a lot. Some people say it's less stable, so in case I switch back I will definitely try the workaround you suggested@Sleepy

Another follow-up question... I've realized some of the extensions for sharing from safari do not allow keyboard shortcuts and hence require me to click . For instance, the Telegram "share" extension will open up a Telegram window to search among my contacts but then I need to select the contact with the mouse (hitting enter will not select it) and then hit "share" with the mouse (again enter will not confirm). Is there any way to work around this , using KM, so that I can do it all via the keyboard?

The desktop app I used from the Telegram website:

and then downloaded them from the Mac App Store @larilela.

I have created a macro for you @larilela, in which you only have to click once.

Please select the Safari extension for Telegram in my macro as follows:

If you are working with the macro, simply enter the desired contact name in the KM popup window.
The macro will then pause until you select the name with a mouse/cursor click. The Safari link will then be sent immediately.

Telegram.kmmacros (35,1 KB)

Here is a way @larilela how you can not only share the link, but also write a text about it.
But then you work with the desktop app and only with the keyboard:

Please note that I have changed the shortcut to send the message to cmd + Enter in the Telegram settings.
Unfortunately, the Telegram app currently only allows very few shortcuts. :disappointed:

Telegram : Message.kmmacros (8,5 KB)

Thanks so much for this macro - and apologies for my late reply. I only now got around to trying it out properly and it works like a charm and hence has been incorporated into my workflow

1 Like

Is no problem @larilela :wink: I am happy that I could help you with the macro.