Python Forum
Detecting Buttons - Suggestions?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting Buttons - Suggestions?
#1
Good morning,

I'm looking for some advice on tutorials and self study. I'm working on automating some of my workflow because I use a lot of different programs (some with apis for python, some without) and it can be frustrating to perform a lot of repetitive tasks.

One approach that I'm considering is having a program flip through all the windows, programs, and internet browsers I have open and then click appropriate buttons based on visual cues.

My question is whether there is a tutorial to help with this sort of thing. I'd essentially like to find a button on a screen and click the button. The button doesn't have a predefined location so the program would have to locate it (across multiple monitors?), apply a coordinate to it, and then use the python mouse click function.

An internet search suggested that having the program take a screenshot of my computer's desktop and then doing an image comparison for the button would be a viable option, but it also said that if the image isn't an exact match, then it wouldn't be able to locate and click the button. Which led me to read about the MSE and SSIM for image comparisons.

Am I going down the right path here, or is there a better way to do this?
Reply
#2
(Nov-28-2023, 11:24 AM)RockBlok Wrote: One approach that I'm considering is having a program flip through all the windows, programs, and internet browsers I have open and then click appropriate buttons based on visual cues.

Something like that would contradict all security aspects of an operating system.
Reply
#3
Hmm, I didn't even think about security.

I know there are different "user" levels in windows. Is it possible to run a program at a specific user level or such?
Reply
#4
I found a video that shows some of the basics and figured I'd share it. The video seems oriented toward people who play games, but I think the explanations are straightforward.

It seems there are built in image match "confidence levels" checks for these python modules so you can choose to not have an exact match. I'll give this a try this weekend.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] [Solved]Detecting key press in gui Barrowman 5 22,386 Apr-24-2020, 01:42 AM
Last Post: Larz60+
  suggestions for a GUI client program Skaperen 1 3,745 Oct-21-2016, 05:49 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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