Trevons Posted August 12, 2020 Posted August 12, 2020 Hello I have a question. The ControlClick command does not work for me. If it is used, nothing happens. Could someone help me? ControlClick("[Class:#32770]", "", "[Class:Button;Instance:1]")
Zedna Posted August 12, 2020 Posted August 12, 2020 Try to add WinActivate() and/or ControlFocus() before ControlClick() Resources UDF ResourcesEx UDF AutoIt Forum Search
Trevons Posted August 12, 2020 Author Posted August 12, 2020 I did add WinActive() but it still doesn't work WinActivate("Installer Language","Please select a language.") ControlClick("[Class:#32770]", "", "[Class:Button;Instance:1]")
Nine Posted August 12, 2020 Posted August 12, 2020 What is the application ? Show a runable script, so we can test it on our side. Unless someone is a diviner, debugging a single line of code is kind of impossible. “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 Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Trevons Posted August 12, 2020 Author Posted August 12, 2020 the script should install a program automatically, mouse movements and clicks should happen automatically
Nine Posted August 12, 2020 Posted August 12, 2020 Did you read my reply ? Post all your code and tell us what is the application your are trying to automate ! “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 Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Trevons Posted August 12, 2020 Author Posted August 12, 2020 i only have this litte bit of code. i tried it but it didnt work
Trevons Posted August 12, 2020 Author Posted August 12, 2020 Just now, Trevons said: i only have this litte bit of code. i tried it but it didnt work this should press the first button from an installation
Nine Posted August 12, 2020 Posted August 12, 2020 Please use this tool when you post code. You can do a silent install of Notepad++ by using /S. See other switches for a complete run command. Earthshine 1 “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 Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Trevons Posted August 12, 2020 Author Posted August 12, 2020 8 minutes ago, InnI said: #RequireAdmin I tried it and it worked Thank you
Trevons Posted August 12, 2020 Author Posted August 12, 2020 Now I have another problem. I have three buttons and I have to press the one in the middle but it doesn't work #RequireAdmin ShellExecute("C:\Users\Mitarbeiter\Desktop\AutoIT\npp.7.8.9.Installer.x64.exe") WinWait("Installer Language","Please select a language.") WinActivate("Installer Language","Please select a language.") ControlClick("[Class:#32770]", "", "[Class:Button;Instance:1]") WinWait("Installation von Notepad++ v7.8.9","Willkommen beim ") WinActivate("Installation von Notepad++ v7.8.9","Willkommen beim ") ControlClick("Installation von Notepad++ v7.8.9","Willkommen beim ", "&Weiter >", "left") WinWait("Installation von Notepad++ v7.8.9","Lizenzabkommen ") WinActivate("Installation von Notepad++ v7.8.9","Lizenzabkommen ") ControlClick("Installation von Notepad++ v7.8.9","Willkommen beim ", "&Annehmen", "middle") WinWait("Installation von Notepad++ v7.8.9","Zielverzeichnis auswählen ")
InnI Posted August 12, 2020 Posted August 12, 2020 "middle" is a mouse button, not a setup button ControlClick("Installation von Notepad++ v7.8.9", "Willkommen beim ", "&Annehmen")
Trevons Posted August 12, 2020 Author Posted August 12, 2020 Just now, InnI said: "middle" is a mouse button, not a setup button ControlClick("Installation von Notepad++ v7.8.9", "Willkommen beim ", "&Annehmen") ok thank you
Earthshine Posted August 12, 2020 Posted August 12, 2020 (edited) you have to wait for stuff to actually happen. you should wait to do the control click until the control is actually in memory and available you should just do as advised and silent install it using a command line, super easy to implement and more reliable as well. Edited August 12, 2020 by Earthshine My resources are limited. You must ask the right questions
Zedna Posted August 12, 2020 Posted August 12, 2020 Try to add WinWaitActive() before ControlClick() Resources UDF ResourcesEx UDF AutoIt Forum Search
Musashi Posted August 12, 2020 Posted August 12, 2020 3 hours ago, Nine said: You can do a silent install of Notepad++ by using /S. See other switches for a complete run command. 1 hour ago, Earthshine said: you should just do as advised and silent install it using a command line, super easy to implement and more reliable as well. I also advise to use the command line option, as already suggested by @Nine and @Earthshine . /S for Silent Install /D= for the desired installation directory Example : npp.7.8.9.Installer.x64.exe /S /D=%ProgramFiles%\Notepad++\ Unfortunately I could not find a switch for the language selection (if this switch exists at all). It seems that the local setting is used automatically. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Earthshine Posted August 12, 2020 Posted August 12, 2020 (edited) if you MUST do it manually, I will have to look at the Notepad++ installer, which one you installing? I have a handy little udf for waiting dynamically for the control to be actually loaded and ready to respond. it's made for automating installers. Edited August 12, 2020 by Earthshine My resources are limited. You must ask the right questions
Earthshine Posted August 12, 2020 Posted August 12, 2020 (edited) lol, use the information tool the control you want to manipulate is a COMBO BOX [CLASS:ComboBox; INSTANCE:1] not the way you are trying to use it, it's a combo box, not a button. unless you need to select a different language you would just press the OK button. the installer sets your language to your local anyway as mentioned above. [Class:Button;Instance:1] Edited August 12, 2020 by Earthshine My resources are limited. You must ask the right questions
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