I have this code that detects an image and click it. There is no mistake in the code but unfortunately the code doesn't work for zoom app and it works just fine in another application.
import pyautogui
import time
pyautogui.FAILSAFE = False
try:
x, y = pyautogui.locateCenterOnScreen(r'C:\Users\Owner\VSCODE\codes\images\zoom.png', confidence=0.9)
pyautogui.click(x, y)
pyautogui.hotkey('alt', 'f4')
time.sleep(1)
pyautogui.hotkey('tab', 'enter')
except TypeError:
print("A TypeError has been occured!")