Pywinauto – detecting and connecting to a second pop up with the same window title? /u/I_P_L Python Education

I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes.

This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are:

  • Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it.
  • Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has.
  • Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated.

submitted by /u/I_P_L
[link] [comments]

​r/learnpython I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes. This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are: Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it. Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has. Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated. submitted by /u/I_P_L [link] [comments] 

I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes.

This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are:

  • Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it.
  • Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has.
  • Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated.

submitted by /u/I_P_L
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *