-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop_launcher.py
More file actions
57 lines (49 loc) · 2.31 KB
/
desktop_launcher.py
File metadata and controls
57 lines (49 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import pyautogui
import time
# pyautogui.click(460, 1050) #spark
# pyautogui.click(510, 1050) #chrome
# pyautogui.click(560, 1050) #rubymine
# pyautogui.click(610, 1050) #intelij
# pyautogui.click(660, 1050) #pycharm
spark_screenshot_path = r"C:\Users\rasha\PycharmProjects\MouseMover\spark\\"
###################### Spark ######################
if pyautogui.locateCenterOnScreen(spark_screenshot_path + "spark.png", confidence=0.9) is None:
print("Spark Not Available!")
else:
x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "spark.png", confidence=0.9)
pyautogui.click(x, y)
###################### Chrome ######################
time.sleep(5)
if pyautogui.locateCenterOnScreen(spark_screenshot_path + "chrome.png", confidence=0.9) is None:
print("Chrome Not Available!")
else:
x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "chrome.png", confidence=0.7)
pyautogui.click(x, y)
###################### RubyMine ######################
time.sleep(5)
if pyautogui.locateCenterOnScreen(spark_screenshot_path + "rubymine.png", confidence=0.9) is None:
print("RubyMine Not Available!")
else:
x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "rubymine.png", confidence=0.9)
pyautogui.click(x, y)
###################### VisualStudioCode ######################
time.sleep(5)
if pyautogui.locateCenterOnScreen(spark_screenshot_path + "VisualStudioCode.png", confidence=0.7) is None:
print("VisualStudioCode Not Available!")
else:
x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "VisualStudioCode.png", confidence=0.7)
pyautogui.click(x, y)
###################### Intelij ######################
# time.sleep(4)
# if pyautogui.locateCenterOnScreen(spark_screenshot_path + "intelij.png", confidence=0.7) is None:
# print("Intelij Not Available!")
# else:
# x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "intelij.png", confidence=0.7)
# pyautogui.click(x, y)
###################### PyCharm ######################
time.sleep(2)
if pyautogui.locateCenterOnScreen(spark_screenshot_path + "pycharm.png", confidence=0.7) is None:
print("PyCharm Not Available!")
else:
x, y = pyautogui.locateCenterOnScreen(spark_screenshot_path + "pycharm.png", confidence=0.7)
pyautogui.click(x, y)