Last active
January 30, 2020 17:41
-
-
Save heyimalex/bcab630a44dfda73ce4a34f50329d12f to your computer and use it in GitHub Desktop.
Nexhealth toy project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess as sp | |
import pyautogui | |
import time | |
child = sp.Popen(["write.exe"]) | |
time.sleep(1) | |
pyautogui.typewrite('Dae Choi is the best.\nGive me a job!', interval=0.1) | |
# Save | |
pyautogui.hotkey('ctrl', 's') | |
# Name the file | |
pyautogui.typewrite('alex-guerra-plea.rtf', interval=0.1) | |
# Bump the directory to desktop | |
pyautogui.hotkey('alt', 'up') | |
pyautogui.hotkey('alt', 'up') | |
pyautogui.hotkey('alt', 'up') | |
pyautogui.hotkey('alt', 'up') | |
pyautogui.hotkey('alt', 'up') | |
# Finalize the save | |
pyautogui.hotkey('enter') | |
# Select yes in the file overwriting dialogue. | |
pyautogui.hotkey('tab') | |
pyautogui.hotkey('enter') | |
# This worked but was slow, so I just did the tab/enter regardless since it doesn't | |
# change anything in the non-overwriting case. | |
# | |
# Check for already exists dialogue popup. | |
#time.sleep(.500) | |
#try: | |
# pyautogui.locateOnScreen('exists.png' | |
# pyautogui.hotkey('tab') | |
# pyautogui.hotkey('enter') | |
#except pyautogui.ImageNotFoundException | |
# pass | |
# Exit | |
time.sleep(.500) | |
pyautogui.hotkey('alt', 'f') | |
pyautogui.hotkey('x') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment