Jump to content

Recommended Posts

Posted

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.

Posted (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 by mikjay
Posted (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 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
Posted

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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...