Skip to content

Instantly share code, notes, and snippets.

@rijkvp
Created March 19, 2021 12:48
Show Gist options
  • Save rijkvp/369e19468e4c72b657769a0a604b10af to your computer and use it in GitHub Desktop.
Save rijkvp/369e19468e4c72b657769a0a604b10af to your computer and use it in GitHub Desktop.
Automatiacally joins MS Teams meetings
# Create screenshots of the Join and Join Now buttons in Teams
import pyautogui # install with: pip3 install pyautogui
import time
while True:
print("Started searching for the join button. Make sure you're in the right channel or team.")
join_button_pos = pyautogui.locateOnScreen("teams-join.png", confidence=0.9, grayscale = True)
if join_button_pos != None:
click_point = pyautogui.center(join_button_pos)
pyautogui.click(click_point.x, click_point.y)
print("Pressed the join button")
print("Searching for the 'join now' button..")
time.sleep(1)
join_now_button_pos = pyautogui.locateOnScreen("teams-join-now.png", confidence=0.9, grayscale = True)
if join_now_button_pos != None:
join_now_click = pyautogui.center(join_now_button_pos)
pyautogui.click(join_now_click.x, join_now_click.y)
print("Pressed the join now button")
time.sleep(1)
print("Joined the meeting!")
quit()
else:
print("Couldn't find the Join Now button!")
time.sleep(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment