m0ngr31 Posted October 28, 2011 Posted October 28, 2011 I'm trying to make a simple script that will turn off program updates (Java, adobe reader and flash, quicktime, ect), and it works great if every computer is on the same page, but some computers have already had Java update, for instance, disabled. This messes up my script because it assumes it needs to tab through the options and select certain checkboxes/radio buttons. Is there a way to check if something is enabled already so I can just throw an IF statement in there? I've seen threads about checking the boxes for windows that AutoIt has created, but I'm not sure how to make it work in a regular window... Any suggestions? Here's my code: ;Disable Adobe Reader Updates Run("C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe") WinWaitActive("Adobe Reader") Send("!en") WinWaitActive("Preferences") Send("uu!n{ENTER}") WinWaitActive("Adobe Reader") WinClose("Adobe Reader") ;Disable Flash Updates Run("control C:\Windows\system32\FlashPlayerCPLApp.cpl") WinWaitActive("Flash Player Settings Manager") Send("{RIGHT}{RIGHT}{RIGHT}{TAB}{TAB}{DOWN}") WinClose("Flash Player Settings Manager") ;Disable Java Updates Run("C:\Program Files\Java\jre6\bin\javacpl.exe") WinWaitActive("Java Control Panel") Send("{RIGHT}{TAB}{TAB}{SPACE}") WinWaitActive("Java Update - Warning") Send("{TAB}{ENTER}") WinWaitActive("Java Control Panel") Send("{TAB}{TAB}{TAB}{TAB}{ENTER}{ENTER}")
water Posted October 28, 2011 Posted October 28, 2011 (edited) To determine if a box of another application is checked use: ControlCommand ("title", "text", controlID, "IsChecked") Replace "title" and "text" with the corresponding data of the application to automate. The controlID can be determined by the AutoIt WindowInfo tool. Edited October 28, 2011 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Gerald Posted October 29, 2011 Posted October 29, 2011 or you can your the If else statement if ControlCommand ("title", "text", controlID, "IsChecked") Then condition here Else condition here endif
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