1

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:

Teams-Auto-Joiner - GitHub

Reddit Thread

  • Can you try mouse click using pymouse? Look at Vlad's answer [here](https://stackoverflow.com/questions/3545230/simulate-mouse-clicks-on-python) – Sarwagya Aug 25 '20 at 13:42
  • Also can you try running this script as admin? I get an error saying `You must be root to use this library on linux.` – Sarwagya Aug 25 '20 at 13:51

0 Answers0