Find text and check radio button which is right side to it
-
- Posts: 21
- Joined: 02 Jun 2016, 00:07
Find text and check radio button which is right side to it
Hello, any one here please help me with this. I'm automating some part of my work. I want to find a text(a word) and select the radio button which is some pexels away (on the right side to it) from it. How can I do this?
Re: Find text and check radio button which is right side to it
Hello there!
You find the word or the image you're looking for and add a few pixels or subtract a few pixels. Like this:
And this:
You find the word or the image you're looking for and add a few pixels or subtract a few pixels. Like this:
Code: Select all
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
SetWorkingDir %A_ScriptDir%
ImageSearch, coordx, coordy, 0, 0, A_ScreenWidth, A_ScreenHeight, image.bmp
if (ErrorLevel = 2)
msgbox theres something wrong ; script is messed up
if (ErrorLevel = 1)
msgbox cant see it ; script is working, but the image isnt on the screen
if (ErrorLevel = 0)
MouseMove, coordx, coordy ; move your mouse to the exact image
Return
Code: Select all
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
SetWorkingDir %A_ScriptDir%
ImageSearch, coordx, coordy, 0, 0, A_ScreenWidth, A_ScreenHeight, image.bmp
if (ErrorLevel = 2)
msgbox theres something wrong
if (ErrorLevel = 1)
msgbox cant see it
if (ErrorLevel = 0)
MouseMove, coordx+50, coordy-20 ; move the mouse a few pixels to the side, play with these numbers until you get it right
Return
-
- Posts: 21
- Joined: 02 Jun 2016, 00:07
Re: Find text and check radio button which is right side to it
Hello frd, many thanks for the help. Where should I put the word in this script which I want to find?
Re: Find text and check radio button which is right side to it
You should take a screenshot and make a picture of the word you're looking for (you´ve got to create a jpeg or a BMP of it). That's probably the easiest path to do what you're trying to do. Does this help?Libran boy wrote: ↑28 Jun 2019, 00:19Hello frd, many thanks for the help. Where should I put the word in this script which I want to find?
-
- Posts: 21
- Joined: 02 Jun 2016, 00:07
Re: Find text and check radio button which is right side to it
Hello frd, the thing is, I will be working on chrome pages. I have to click some places in a page repeatedly. I'm attaching an image to this reply. Kindly refer to it so you can understand. So, what I want to do is, when I press a key like f1, the program should be able to find the word (only text and not images) and click some predefined places(right side and down sometimes).
To sum it up, I want to find a word or text like "do you drink coffee?" and click "yes" or "no" after the text is found. Hope you understood. Thanks for your valuable time.
To sum it up, I want to find a word or text like "do you drink coffee?" and click "yes" or "no" after the text is found. Hope you understood. Thanks for your valuable time.
- Attachments
-
- images (1).png (5.39 KiB) Viewed 1030 times