mikekstitzel Posted December 15, 2010 Share Posted December 15, 2010 Hi, I am a new user to autoit, so please be gentle. I am a UNIX Admin but am new to the PC world. I am trying to do an autoit script for "Perfect Uninstaller". When the program gets to the app window I need to left click on the register button. No combination of TAB, Arrows, ect. will move the mouse cursor to the register button so I tried it using mouse click. I obtained the control data using the "autoit window info" app, the control I need to left click on is: TITLE:Perfect Uninstaller; CLASS:TPanel; INSTANCE:6 I am failing to do something as the "click" does not happen. Here is my code: run("Perfect_Uninstaller_v6_3_3_8_Setup.exe") WinWaitActive("Setup - Perfect Uninstaller") Send("{ENTER}") WinWaitActive("Setup - Perfect Uninstaller") Send("{TAB}{UP}{ENTER}") WinWaitActive("Setup - Perfect Uninstaller") Send("{ENTER}") WinWaitActive("Setup - Perfect Uninstaller") Send("{ENTER}") WinWaitActive("Setup - Perfect Uninstaller") Send("{ENTER}") Opt("WinWaitDelay", 5250) WinWaitActive("Setup - Perfect Uninstaller") Send("{ENTER}") WinActivate("[TITLE:Perfect Uninstaller; CLASS:TPanel; INSTANCE:6]","") Opt("WinWaitDelay", 7250) MouseClick("left", 475, 110, 1) ; ControlClick("Perfect Uninstaller","","[12586552]") ; Note: the control ID is not static, it changes each time you try to install ; the software so I am trying to do the mouse click via (TITLE, CLASS, INSTANCE) ; This is where the program stops, the "click" does not happen WinWaitActive("Register") Send("V54CF-3DS7J-ENIEP-ZJWGG") Send("{ENTER}") WinWaitActive("Perfect Uninstaller") Send("{ENTER}") exit I suspect that I have a bad combination of: WinActivate("[TITLE:Perfect Uninstaller; CLASS:TPanel; INSTANCE:6]","") Opt("WinWaitDelay", 7250) MouseClick("left", 475, 110, 1) I really have tried to resolve this on my own, I am just mis-reading the help pages or something, I have another autoit app that is doing the same thing. I probably have 5 hours between the two trying to fix them. Is there a way to line by line "step" through your script? I know it is something simple, can someone hold my hand ? Thanks! mikekstitzel at gmail I tried to use the au3recorder but get "DLL load Failed". Here is my Computer Config: Computer Type ACPI x64-based PC Operating System Microsoft Windows 7 Ultimate OS Code Name Vienna OS Kernel Type Multiprocessor Free (64-bit) OS Version 6.1.7600 (Win7 RTM) .NET Framework 3.5.30729.4926 built by: NetFXw7 DirectX DirectX 11.0 OpenGL 6.1.7600.16385 (win7_rtm.090713-1255) Gigabyte 870A-UD3 rev: 2.1 F2 Bios OCZ-AGILITY2 80GB SSD boot disk AMD Phenom II X6 1055T @ 3.7Ghz Kingston DDR3 SDRAM 1333, 4each 2GB NVIDIA GeForce 8800 GTS WH10LS30 Optical Drive AMD 3+1 Disk RAID5 (2793 GB), 4 each Hitachi HDS721010KLA330 7200 RPM, SATA-II drives (no system files are on the Raid) 1 each Hitachi HDS721010KLA330 (for a fast file system, no system files are on the drive) I have tried for half an hour to cut and paste the darn window here but I can not get it to work for some reason, maybe it is not allowed? Arrrggg... Link to comment Share on other sites More sharing options...
MvGulik Posted December 15, 2010 Share Posted December 15, 2010 (edited) nevermind. Edited June 28, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
mikekstitzel Posted December 15, 2010 Author Share Posted December 15, 2010 yes, on the new to forums, yes, on the admin, what is a "nice code box" ? I will certainly do as requested. Thanks for the heads up Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 15, 2010 Moderators Share Posted December 15, 2010 mikekstitzel,Another "Welcome" to the AutoIt forum. When you post code it is best to use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here).As to your problem, I would suggest a couple of things you might try (assuming the control you mention is a button):- 1. WinActivate only works for GUIs, not the controls in them. I would try to use ControlClick directly on the button:ControlClick("Setup - Perfect Uninstaller", "", "[CLASS:TPanel; INSTANCE:6]")- 2. If that does not work then find the position of the dialog with WinGetPos, add an offset for the button and use MouseClick at those coordinates.For the rest of your script, a couple of comments:- 1. Use a short Sleep rather than WinWaitActive between each Send command. The GUI is already activated and so waiting does little good - a short Sleep(100) would be better in my experience to allow the keystroke to register and the GUI to react.- 2. Remove the Opt("WinWaitDelay") lines. Do you really want 5 or 7 second delays between actions?Give those a try and see if you get what you want. If not then please can you post a screenshot of the GUI so we can see what you are actually trying to do. It always helps! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MvGulik Posted December 15, 2010 Share Posted December 15, 2010 (edited) nevermind. Edited June 28, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
mikekstitzel Posted December 15, 2010 Author Share Posted December 15, 2010 Thanks for the quick replies, I am going to have to figure out why I can't cut and past "windows", I have done it in the past. Maybe it's too late in the day;-) Melba23 gave me a good direction to work towards, My app still does not complete, but when I click on the offending item it does continue until completion, so I know I am on the right track now. The reason why I put in the Opt("WinWaitDelay", 5250) was the script was not waiting until file copies were done, thank you for telling me a better way of doing it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 15, 2010 Moderators Share Posted December 15, 2010 mikekstitzel,script was not waiting until file copies were doneIf there is something which changes on the GUI when the file copies are done (e.g. button text, status bar text, button colour) then it is a good idea to check that and use it as a trigger rather then waiting for a fixed time. Keep at it - you know where we are if you cannot get it to work! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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