amb2301 Posted January 6, 2020 Share Posted January 6, 2020 Hi friends, i have an application, which has non standard Class Name & Controls, i cant able to use controlclick as it is not capturing any visible texts, Please help me with some sample scripts like......finding the text & clicking on it...... Please check the below image for the reference, actually i need to click on the word "Pre Con" Link to comment Share on other sites More sharing options...
Zedna Posted January 6, 2020 Share Posted January 6, 2020 Try _ImageSearch() + MouseClick() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
markyrocks Posted January 7, 2020 Share Posted January 7, 2020 is it in the same place every time? is there anyway that you can force it to be in the same place every time via a window move or other window manipulation? Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 7, 2020 Share Posted January 7, 2020 @amb2301 Use UI Automation if possible, since both ImageSearch UDF and Mouse* functions are not so reliable solutions Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 14 hours ago, markyrocks said: is it in the same place every time? is there anyway that you can force it to be in the same place every time via a window move or other window manipulation? Hi markyrocks, thanks for looking on this post, actually its not same place at every time, so could you please suggest any solution Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 14 hours ago, markyrocks said: is it in the same place every time? is there anyway that you can force it to be in the same place every time via a window move or other window manipulation? Hi FrancescoDiMuro, i am not aware of UI Automations, could you please explain me that one.. Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 16 hours ago, Zedna said: Try _ImageSearch() + MouseClick() Hi Zedna, i will try with image search & get back to u ASAP Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 @Zedna #include <ImageSearch.au3> #include <ImageListConstants.au3> #include <ImageSearch2015.au3> $x1=0 $y1=0 MsgBox(0,"start","start") do $result = _ImageSearch("\\corp.ads\users\VDIUserDataKIDC1\x173795\Desktop\6004917_IPSF\test1.png",1,$x1,$y1,0) until $result = 1; if $result=1 Then MouseMove($x1,$y1,3) MouseClick("left", $x1,$y1, 1) WinWait("[Title:TightVNC File Transfer]", "", 10) else MsgBox(0,"MSG","End") EndIf EndFunc i tried with _ImageSearch() + MouseClick(), it shows some error as shown below, could you please check it..... "\\corp.ads\users\VDIUserDataKIDC1\x173795\Desktop\SNET Reports fetch tool.au3" (18) : ==> "Func" statement has no matching "EndFunc".: EndFunc >Exit code: 1 Time: 0.7089 Link to comment Share on other sites More sharing options...
markyrocks Posted January 7, 2020 Share Posted January 7, 2020 2 hours ago, amb2301 said: @Zedna #include <ImageSearch.au3> #include <ImageListConstants.au3> #include <ImageSearch2015.au3> $x1=0 $y1=0 MsgBox(0,"start","start") do $result = _ImageSearch("\\corp.ads\users\VDIUserDataKIDC1\x173795\Desktop\6004917_IPSF\test1.png",1,$x1,$y1,0) until $result = 1; if $result=1 Then MouseMove($x1,$y1,3) MouseClick("left", $x1,$y1, 1) WinWait("[Title:TightVNC File Transfer]", "", 10) else MsgBox(0,"MSG","End") EndIf EndFunc <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DELETE THIS i tried with _ImageSearch() + MouseClick(), it shows some error as shown below, could you please check it..... "\\corp.ads\users\VDIUserDataKIDC1\x173795\Desktop\SNET Reports fetch tool.au3" (18) : ==> "Func" statement has no matching "EndFunc".: EndFunc >Exit code: 1 Time: 0.7089 When i talk about forcing it into the same position. A trick i use to manipulate windows that i have issues with is either making sure theyre maximized so that theyre the same size and the same position everytime hence everything inside usually is too (unless stuff is just moving around the window randomly....never really ran into that issue but anything is possible). also if the window cannot be maximized for whatever reason then i'll use winmove and put the window at the same position everytime so again in theory everything inside should be in the same position. These things should hopefully get you one step closer. also to use with these methods is if the button needing clicked could be in a few separate places, not random just the same couple of different spots. I'll just use pixelgetcolor and check one pixel in a specific image in the box im trying to click (figure out whatever color that is using msgbox or consolewrites) then set up conditional statements to determine where the thing needs to click. It can be a real pita to do what your describing. I've definitely been there, but i've never found a program that i couldnt get something to work. Also a useful trick all these other techniques in mind you can also use a cursor change as an indication that it is getting ready to click on the right thing. Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 (edited) 54 minutes ago, markyrocks said: Edited January 7, 2020 by amb2301 Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 (edited) 50 minutes ago, markyrocks said: When i talk about forcing it into the same position. A trick i use to manipulate windows that i have issues with is either making sure theyre maximized so that theyre the same size and the same position everytime hence everything inside usually is too (unless stuff is just moving around the window randomly....never really ran into that issue but anything is possible). also if the window cannot be maximized for whatever reason then i'll use winmove and put the window at the same position everytime so again in theory everything inside should be in the same position. These things should hopefully get you one step closer. also to use with these methods is if the button needing clicked could be in a few separate places, not random just the same couple of different spots. I'll just use pixelgetcolor and check one pixel in a specific image in the box im trying to click (figure out whatever color that is using msgbox or consolewrites) then set up conditional statements to determine where the thing needs to click. It can be a real pita to do what your describing. I've definitely been there, but i've never found a program that i couldnt get something to work. Also a useful trick all these other techniques in mind you can also use a cursor change as an indication that it is getting ready to click on the right thing. Actually the sizes are not getting changed, because its a button kind of thing in Autocad Application, even if i maximize the size of picture snipped should match with it. so any suggestions.. Edited January 7, 2020 by amb2301 Link to comment Share on other sites More sharing options...
markyrocks Posted January 7, 2020 Share Posted January 7, 2020 (edited) 1 hour ago, amb2301 said: Actually the sizes are not getting changed, because its a button kind of thing in Autocad Application, even if i maximize the size of picture snipped should match with it. so any suggestions.. Can you explain why the item you're describing isn't in the same position everytime? Obviously by no means do I suggest abandoning the idea of using imagesearch. I've just never had very much luck with it. In addition to my other suggestions using a programs hotkeys is also useful. Like it's easier to send a hotkey than it is to find a button to click on. Also I'd like to point out that using a screenshot to capture an image and then searching the image from memory seems like a more reliable path than just searching the screen. Obviously this is kinda a pita but I've had better results with that than just using pixelsearch or imagesearch on the screen. Edited January 7, 2020 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
junkew Posted January 7, 2020 Share Posted January 7, 2020 Read faq31 and let us know what the spying tools are telling you FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
amb2301 Posted January 7, 2020 Author Share Posted January 7, 2020 1 hour ago, markyrocks said: Can you explain why the item you're describing isn't in the same position everytime? Obviously by no means do I suggest abandoning the idea of using imagesearch. I've just never had very much luck with it. In addition to my other suggestions using a programs hotkeys is also useful. Like it's easier to send a hotkey than it is to find a button to click on. Also I'd like to point out that using a screenshot to capture an image and then searching the image from memory seems like a more reliable path than just searching the screen. Obviously this is kinda a pita but I've had better results with that than just using pixelsearch or imagesearch on the screen. As you suggested, i tried using hotkeys, its done now, Thank you so much for your help markyrocks 1 Link to comment Share on other sites More sharing options...
markyrocks Posted January 8, 2020 Share Posted January 8, 2020 1 hour ago, amb2301 said: As you suggested, i tried using hotkeys, its done now, Thank you so much for your help fantastic Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now