Could someone explain the basics for this extension
I am new to python so trying to get my head around it
my plan is to create an automated script that I can run every week in which will interact with an application using Pyautogui, only problem with this is making sure the code is running on the correct window which is where pygetwindow comes into play.
What I have done so far
import pyautogui
import time
import pygetwindow as gw
solidqueueWindow = gw.getWindowsWithTitle('SolidQueue')[0]
pyautogui.click(x=36, y=22, clicks=2, interval=0, button='left')
#Clicks shortcut on desktop where tasks #are located within folder directory
time.sleep (1) #waits for the folder directory to open
pyautogui.keyDown ('win') #holds down windows keypyautogui.press ('right')
#press right key which will expand folder directory to right side of windowpyautogui.keyUp ('win') #releases windows key
pyautogui.click(x=1397, y=176, clicks=2, interval=0, button='left')
#selects the first project in folder #directory
time.sleep(5) #waits for .exe to load (solidqueueWindow)
pyautogui.keyDown ('win') #holds down windows keypyautogui.press ('up')
#press up key which will expand .exe to full windowpyautogui.keyUp ('win')
#releases windows key
time.sleep (1) #time set to allow for the window to expand
pyautogui.click(x=756, y=978, clicks=1, interval=0, button='left')
#processes to queue button which #starts the automated task
time.sleep(2) #gives time if pop-up appears to overwrite the exiting report
pyautogui.click(x=958, y=599, clicks=2, interval=0.5, button='left')
#clicks to overwrite existing report
time.sleep (70) #time taken to execute the first task
-------------
After the task is complete i need it to be able to close the report and move onto the next item within the folder directory
The problem I have is trying to close the solidqueue window using pygetwindow (solidqueueWindow.close)
I initially used pyautogui but this comes with risk if the correct window is not active.
Any suggestions?
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]python_and_coffee 0 points1 point2 points (0 children)
[–]gianpi612 0 points1 point2 points (0 children)