YMJEF Posted October 31, 2022 Share Posted October 31, 2022 Hey all, I'm new to AutoIT and I've been playing around with it for a little bit, though I still can't fully wrap my head around how I'm supposed to achieve my goal. The solution will be integrated through Ansible. Letting Ansible talk to AutoIT is simple enough, so that can be disregarded. The program I'm trying to deploy needs to automatically tick the two checkboxes outlined in red followed by hitting the "Register" button (Screen1). Once this is done another window will pop up where one has to click the confirm button (Screen2). I would like to have all of this automated so that I can integrate it in my Ansible solution so that all of this can be performed automatically. What is the best course of action? Are there perhaps any resources for me to look at in order to achieve this? Thanks in advance! Link to comment Share on other sites More sharing options...
Nine Posted October 31, 2022 Share Posted October 31, 2022 (edited) First of all, you need to know if the controls are accessible with standard Window (see Au3Info.exe) or UIAutomation (see UIASpy.au3). Start using Au3Info tool located at the root of the AutoIt folder. Report here the result of one of the controls. Edited October 31, 2022 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
YMJEF Posted November 2, 2022 Author Share Posted November 2, 2022 On 10/31/2022 at 5:03 PM, Nine said: First of all, you need to know if the controls are accessible with standard Window (see Au3Info.exe) or UIAutomation (see UIASpy.au3). Start using Au3Info tool located at the root of the AutoIt folder. Report here the result of one of the controls. Hey Nine, Sorry for the late reply! Here's what the AutoIt3 window reports. The controls that I want to modify are all buttons and the instances are "2" "3" and "6" Link to comment Share on other sites More sharing options...
Nine Posted November 2, 2022 Share Posted November 2, 2022 Report Control Tab “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
YMJEF Posted November 2, 2022 Author Share Posted November 2, 2022 15 minutes ago, Nine said: Report Control Tab Hey Nine, Is this the tab that you're looking for? Link to comment Share on other sites More sharing options...
Nine Posted November 2, 2022 Share Posted November 2, 2022 As you can see you have handle and id of your controls, so you should be able to manipulate them. In help file see ControlS functions under Window Management. There is also a large number of functions in the User Define Functions Reference / GUI Reference / GuiButton Management. Try of few of those functions, return back your script if you need help. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
YMJEF Posted November 2, 2022 Author Share Posted November 2, 2022 Hey Nine, I've tried using ControlClick in order to perform what I'm trying to do. This seemed to work initially as it parsed all the commands, but it tried clicking in the centre of the Control resource. I then tried to add some modifiers such as button and position to click, but it threw a subscript error at me. The script below is what I've tried to run. ; Run BLANK Run ("BLANK.exe") WinWaitActive ("BLANK") ControlClick("BLANK", "", "1024" [, button = "left" [, clicks = 1 [, x7 [, y6)]]]] ) WinWaitActive ("BLANK") ControlClick("BLANK", "", "1022" [, button = "left" [, clicks = 1 [, x7 [, y6)]]]] ) WinWaitActive ("BLANK") Send("{Enter}") WinWaitActive ("Confirm") Send("{Enter}") Link to comment Share on other sites More sharing options...
Nine Posted November 2, 2022 Share Posted November 2, 2022 When you post code, use tag as described in the link. Your controlClick statements are made wrong (bracket means optional parameter) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
Solution abberration Posted November 2, 2022 Solution Share Posted November 2, 2022 Hi, I'm assuming that you are blanking out portions of your screenshots because you think they may compromise your security. Not knowing what application you are trying to install, and it does not appear that you are trying to do anything malicious, I can offer what I think would click the register button for you. In the following code, replace "BLANK" with what the AutoIt Window Info's title box says. ControlClick ("BLANK", "Whitelist Creation", "[CLASS:Button; INSTANCE:2]") If this works, you should be able to figure out the rest for yourself. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
YMJEF Posted November 3, 2022 Author Share Posted November 3, 2022 10 hours ago, abberration said: Hi, I'm assuming that you are blanking out portions of your screenshots because you think they may compromise your security. Not knowing what application you are trying to install, and it does not appear that you are trying to do anything malicious, I can offer what I think would click the register button for you. In the following code, replace "BLANK" with what the AutoIt Window Info's title box says. ControlClick ("BLANK", "Whitelist Creation", "[CLASS:Button; INSTANCE:2]") If this works, you should be able to figure out the rest for yourself. Cheers, this worked! I had already figured out a jerry rigged solution by using commands such as Send + and Send DOWN to navigate through the menu, but this is a lot cleaner. Replacing the Instance number with the target instance number for the other buttons does the trick. 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