industry7 Posted November 11, 2009 Posted November 11, 2009 I need to see if a checkbox is marked or not. I can't seem to find the function to do this. The closest I found were GUICtrlGetState and GUICtrlRead, but the documentation says they can only accept a controlID that was returned by a GUICtrlCreate... function ie. one that I made myself. I need to look at a markbox in the program that I'm trying to automate. I tried used those functions anyway, but couldn't get them to work. So how is this supposed to be done? I feel really dumb that I can't figure out such a basic task.
mikjay Posted November 11, 2009 Posted November 11, 2009 (edited) If the checkbox already exists, you won't be able to get the state using the ctrlread function. What about pixelsearch to find the color black in the box? This is kind of a bad reply, as I answered before I realized it wasn't the GUI you created. Edited November 11, 2009 by mikjay
PsaltyDS Posted November 11, 2009 Posted November 11, 2009 (edited) I need to see if a checkbox is marked or not. I can't seem to find the function to do this. The closest I found were GUICtrlGetState and GUICtrlRead, but the documentation says they can only accept a controlID that was returned by a GUICtrlCreate... function ie. one that I made myself. I need to look at a markbox in the program that I'm trying to automate. I tried used those functions anyway, but couldn't get them to work. So how is this supposed to be done? I feel really dumb that I can't figure out such a basic task. Get the control ID of the checkbox using the AutoIt Window Info tool (AU3Info.exe). Then you can use: $IsChecked = ControlCommand("Window Title", "", $idChkBox, "IsChecked") ; Where $idChkBox is the control ID Edited November 11, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
industry7 Posted November 12, 2009 Author Posted November 12, 2009 Get the control ID of the checkbox using the AutoIt Window Info tool (AU3Info.exe). Then you can use: $IsChecked = ControlCommand("Window Title", "", $idChkBox, "IsChecked") ; Where $idChkBox is the control ID That worked. Thanks a whole bunch!
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