Adding script support for Microsoft Teams

I would like to be able to capture Hook links for messages in Microsoft Teams – similar to the Slack script.

In Teams client, I can copy a link to a certain message and it produces a URL that looks something like this (specific values for my work account are removed):
https://teams.microsoft.com/l/message/<some hash>@thread.skype/?tenantId=<some guid>&groupId=<another guid>&parentMessageId=<some integer id>&teamName=<string of team name>&channelName=<string of channel name>&createdTime=<creation time in epoch time>

Even though I am able to copy this link from within Teams to my clipboard, I would like to be able to copy the link using Hook to get a Hook formatted link, and connect it to another file, Things to-do, etc.

Thanks for any suggestions.

Thanks for asking @runit. We haven’t looked at MS Teams yet. Our first action would be to see if it has AppleScript or other automation to get the URL of the current selection. Based on the URL you provided, the name of the the link could be extracted from it, presumably based on the channelName.

I’ve added an issue here for CogSci Apps to look at it. Maybe someone on the forum has already used Hook with MS Teams.

Microsoft Teams is an Office 365 cloud-based service, which has a desktop “app” for macOS, Windows, etc., which is mainly a wrapper for the cloud service. All URLs are within https://teams.microsoft.com... with complex URL substrings indicating team, channel (sub-team), chat message, or file (within a SharePoint online site collection associated with the team), etc.

There is no scripting support, though I suppose one could do GUI scripting which will probably fail since Microsoft makes frequent, often subtle, changes to the interface.

I do not recommend using the desktop app on macOS because it immaterially different from the web app, and is close to 1/3 GB in size. (Why? Because Microsoft.)

Unless Teams is active in a browser, clicking on a Teams URL will cause the browser to launch and require authentication. It is a lousy user experience.

Great. Thanks for taking a look.

Thanks for the tip @quorm about using the web client of Teams instead of the desktop. I agree there seems little advantage to the desktop app.

I might see if I can use Keyboard Maestro to key in on some of the UX elements in Teams and maybe script it that way. But definitely a very brittle approach.

For those who are using Teams as a Mac app, it turns out to be straightforward to get links (which is what I want for the way I use Hook)

  • Use the “[three dots] - Get link to xxx” menu item in Teams to copy the link to whatever it is.
  • When you click on the link, MacOs intercepts it and asks if you want to open it in the local app. Say yes.

Charles