Python Forum
How to automate the clicking of GUI's menu?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to automate the clicking of GUI's menu?

I have a question about GUI libraries. I am working on an automation program. I use coordinate info of a command (for example, file -> open or about -> help) via pyautogui. However, according to screen resolution or program window location, this command’s coordinate can be changed. To fix this problem, I want to move without coordinate. How can I select a command of a program via GUI libraries? Is it possible to make this? Because I know, pywinauto has a special movement for Notepad (app.Notepad.menu_select(“File->SaveAs”). I wonder, can I use this for other programs?
Okay please clarify your question a bit more -- as far as I know if you presenting something on a screen you have to use coordinates as that is the only way to communicate to the hardware where to place what it is you want drawn on the display device and yes the coordinate system adjusts to the display mechanism(s) as this is what it has to do to render things properly.

Now if you are talking about something else then perhaps you can as the only time you need coordinates are when you are working to display something upon a display device. Your mentioning of coordinates in conjunction with function calls has me a bit confuzzled as these are not synonymous concepts
Yes pywinauto can access the menu directly with other programs than notepad.
In the code app.Notepad.menu_select(“File->SaveAs”) Notepad is not hard coded, it looks for a window with the title Notepad.

pywinauto entry points for automation
Yes, we can work on the menu items directly. Just we have to get the properties of the window/dialog elements and use them directly in your cide

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using IDLE, bug when clicking code StarBasket 4 1,037 Jul-31-2019, 12:30 PM
Last Post: Malt
  1. How can I automate this batch creation of documents? 2. How can I automate posting SamLearnsPython 2 1,703 Jul-02-2018, 11:36 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020