I am trying to write a simple script that will automatically join Microsoft Teams meetings. Following is the code:
#Import libraries
import keyboard, mouse, time, subprocess
def automate(filepath, x, y):
subprocess.call(filepath)
time.sleep(30)
for i in range(len(x)):
mouse.move(x[i], y[i])
mouse.click()
time.sleep(5)
automate("C:\\Users\\aashay\\AppData\\Local\\Microsoft\\Teams\\current\\Teams", [99, 1185, 530], [163, 112, 635])
When I run the script, it opens Teams app but doesn't do anything. The mouse pointer does not move. At times after I close the app, I realized that sometimes the pointer clicks on the coordinates specified in the script but it does not click inside the app. Is there a way to bypass this?
PS: I found a bot specifically for Microsoft Teams on GitHub but it is very detailed and complicated and I couldn't understand most of the code. So, I have decided not to use it and keep it very simple. If anyone wants to check it out: