-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext.py
85 lines (62 loc) · 2.17 KB
/
text.py
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import pyautogui
import time
import subprocess
def draw_circle(x, y, radius):
pyautogui.moveTo(x, y)
pyautogui.dragRel(-radius, radius, duration=0.5) # Draw the circle's bottom side
def draw_oval(x, y, width, height):
pyautogui.moveTo(x, y)
pyautogui.dragRel(width, height, duration=0.5) # Draw the oval's right side
def ms_paint():
# Open Paint using the 'mspaint' command in the background
subprocess.Popen(['mspaint'], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Wait for Paint to start (adjust the delay if needed)
time.sleep(3)
# Send the Alt + Space keys to open the window's system menu
# pyautogui.hotkey('alt', 'space')
# time.sleep(0.5)
#pick the circle tool
for i in range(19):
pyautogui.press('tab')
pyautogui.press("right")
pyautogui.press("right")
pyautogui.press("enter")
# Draw the first circle
draw_circle(400, 400, 50)
# Move to draw the second circle (40 pixels below the first circle)
pyautogui.moveRel(0, 40, duration=0.5)
pyautogui.click()
# Draw the second circle
draw_circle(510, 400, 50)
# Move to draw the second circle (40 pixels below the first circle)
pyautogui.moveRel(0, 40, duration=0.5)
pyautogui.click()
# Click out of the oval
for i in range(20):
pyautogui.press('tab')
pyautogui.press('left')
pyautogui.press('enter')
pyautogui.moveTo(300, 550, duration=0.5)
pyautogui.dragRel(310, 0, duration=0.5)
pyautogui.moveRel(-155, 0, duration=0.5)
pyautogui.dragRel(0, 50, duration=0.5)
# pyautogui.moveRel(100, 100)
# pyautogui.click()
# # Select the text box tool
# for i in range(15):
# pyautogui.press('tab')
# time.sleep(0.1)
# pyautogui.press('enter')
# # Draws the textbox
# draw_oval(325, 440, 400, 80)
# # Changes the font size
# pos = pyautogui.position()
# pyautogui.click(828, 221)
# pyautogui.write("32")
# # Types the message
# pyautogui.moveTo(pos)
# pyautogui.moveRel(-50, -50)
# pyautogui.click()
# pyautogui.write("Test text")
if __name__ == "__main__":
ms_paint()