Jump to content
Sign in to follow this  
industry7

seeing if a checkbox is marked or not

Recommended Posts

industry7

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.

Share this post


Link to post
Share on other sites
mikjay

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
industry7

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!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.