Skip to content

Instantly share code, notes, and snippets.

@shoarai
Last active January 11, 2024 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoarai/888108b2b83bd7bde95fe3bbdc51017f to your computer and use it in GitHub Desktop.
Save shoarai/888108b2b83bd7bde95fe3bbdc51017f to your computer and use it in GitHub Desktop.
F1::toggle_mute_teams()
toggle_mute_teams() {
winList := WinGetlist("ahk_exe Teams.exe",,,)
for window in winList {
if (WinGetTitle(window) != "Microsoft Teams Notification" and WinGetTitle(window) != "") {
WinActivate(WinGetTitle(window))
Send("^+M")
sleep 20 ; sometimes it activates the new window before the sendkeys finishes, delay fixes it
break ; mute shortcut works in both windows, so break after first send
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment