juliet1973 Posted April 11, 2008 Share Posted April 11, 2008 Hello. I've been trying to see the value of a checkbox and check it if it isn't already checked. This is a screen for one of our applications here at work that we are trying to automate entering of data. The checkbox is already drawn for me and there is no ControlID listed in the Active Window Information. My window information says this: >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Microsoft Internet Explorer Class: IEFrame Size: X: -4 Y: -4 W: 1032 H: 748 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Client: X: 543 Y: 255 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xFFFFFF Dec: 16777215 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 538 Y: 253 W: 12 H: 11 Control ID: ClassNameNN: Button1 Text: Style: 0x50000003 ExStyle: 0x00000000 >>>>>>>>>>> Status Bar Text <<<<<<<<<<< (1): Done (2): (3): (4): Pop-ups were allowed. (5): (6): (7): (8): Local intranet I've tried several ways - including trying to use the classname. When I do try to use the classname, the value returned is always zero whether the checkbox is actually checked or not. Here are some of the methods I've tried. Some of them are commented out after I realized it wasn't getting me what I needed. I also thought about trying to use the mouse position, but there isn't any guarantee that this checkbox will always be in the same spot. I also have repeating rows of checkboxes I need to check after the first one. $handle = GuiCtrlRead ( "CLASSNN:Button1" , 0) MsgBox (0, "Text Read Was:", $handle) ;GUICtrlSetState("CLASSNN:Button1",$GUI_ENABLE) ;If ControlCommand ( "Microsoft Internet Explorer", "", "[CLASSNN:Button1]", "IsChecked", "" ) Then ControlCommand ( "Microsoft Internet Explorer", "", "[CLASSNN:Button1]", "UnCheck", "" ) ;$Button1 = ControlCommand ( "Microsoft Internet Explorer", "", "[CLASSNN:Button1]", "IsChecked", "" ) ;If GUICtrlRead("[CLASSNN:Button1, 0]") = $GUI_CHECKED Then GUICtrlSetState("[CLASSNN:Button1, 0]", $GUI_UNCHECKED) ;MsgBox(0, "Text read was:", $Button1) Can anyone help me with this? Am I looking totally in the wrong direction? Am I even close? Is there another method to get the value of a checkbox when the ControlID isn't present? Thanks! Link to comment Share on other sites More sharing options...
covaks Posted April 13, 2008 Share Posted April 13, 2008 ControlCommand("Microsoft Internet Explorer","","Button1","UnCheck") If you always want it unchecked, you don't really need to test first whether or not it is checked. If that's not working, is this a part of some webpage? If so, you might need to use something like _IEFormElementCheckboxSelect Link to comment Share on other sites More sharing options...
juliet1973 Posted April 17, 2008 Author Share Posted April 17, 2008 (edited) Thank you so much for the information. That unfortunately didn't work for me. I did need to verify if it was checked or not and then check it if it wasn't (along with verifying some other information first - so I wouldn't always have to check it). However, I was able to subsitute the class for the control ID and get the value of the checkbox using the Control Command as you suggested. [/code] $Checkbox1 = ControlCommand("Microsoft Internet Explorer", "", "Button1", "IsChecked", "") [code] Thanks so much for your time. Edited April 17, 2008 by juliet1973 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