Created
May 17, 2017 13:34
-
-
Save n0an/715afec920bb351b69f5f19b4ce7a94b to your computer and use it in GitHub Desktop.
pdf from visio
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
#! python3 | |
import pyautogui, time, logging | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%H:%M:%S') | |
# Set these to the correct coordinates for your particular computer. | |
uncheckAutoOpenPDF = (139, 522) | |
pyautogui.PAUSE = 5.0 | |
# firstRun = True | |
print('>>> 5 SECOND PAUSE TO LET USER PRESS CTRL-C <<<') | |
time.sleep(5) | |
while True: | |
logging.info('F12 pressed.') | |
pyautogui.typewrite(['F12']) | |
logging.info('tab pressed.') | |
pyautogui.typewrite(['tab']) | |
logging.info('p pressed.') | |
pyautogui.typewrite('p') | |
logging.info('tick clicked.') | |
pyautogui.moveTo(139, 522, duration = 0.5) | |
pyautogui.click() | |
logging.info('ENTER pressed.') | |
pyautogui.typewrite(['enter']) | |
logging.info('ALT+F4 pressed.') | |
pyautogui.hotkey('alt', 'f4') | |
logging.info('Right pressed.') | |
pyautogui.typewrite(['right']) | |
logging.info('ENTER pressed.') | |
pyautogui.typewrite(['enter']) | |
print('pdf done') | |
time.sleep(2) | |
print('=== Starting next one ===') | |
logging.info('Down pressed.') | |
pyautogui.typewrite(['down']) | |
logging.info('ENTER pressed.') | |
pyautogui.typewrite(['enter']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment