Jump to content

ControlCommand Question

Recommended Posts


I have an autoIt script that I am using this command:

ControlCommand("Clientware", "", "Use Acrobat for Large Files (over 10MB)", "Check", "")

My question is will this always put a check in the box?  Even if there is already a check there?  I had been using a ControlClick and that was working fine until randomly a check was already in the box and the ControlClick was removing the check.

Thank you


Share this post

Link to post
Share on other sites

Pretty sure it will check it, and do nothing if already checked since its stating specifically to "check" not "toggle" but if that is not the case you can always run "ischecked" first to see if the value is 1 or 0 and then check as needed with an if statement. 

Share this post

Link to post
Share on other sites

I tried it but always return zero,

ControlCommand ( "DMS", "", "TwwCheckBox1", "IsChecked", "")  ;always return zero

ControlCommand ( "DMS", "", "TwwCheckBox1", "UnChecked", "") ;Not Working

ControlCommand ( "DMS", "", "TwwCheckBox1", "Checked", "") ;Working,Checking and Unchecking Box

maybe something is wrong with control command Checked, IsChecked and UnChecked

Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post

Link to post
Share on other sites

I just tested with the Notepad++ installer.  

Using "check" does not uncheck the box.  

ControlCommand("Notepad++ v6.7.8.2 Setup", "", 1200, "Check")

I do not even see what you used "Checked" in the command list. 



Also "ischecked" is properly working for me.

$test = ControlCommand("Notepad++ v6.7.8.2 Setup", "", 1200, "IsChecked")
MsgBox(0, "", $test)


Share this post

Link to post
Share on other sites


Nothing is wrong with the ControlCommand. It is just that some applications do not react to some commands in a standard manner, particularly "IsChecked". In the past it has sometimes proved necessary to resort to Pixel* functions to determine the state of a checkbox.


  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

​typo error, whats with the 1200 value?

​Just the ID of the checkbox in that Notepad++ installer.  Its Classname was "Button4"

I used something that was free to download so you could test/try for yourself, but it seems based on what Melba said that most likely its just the application your working with that does not provide results as desired. 

So you may do what I did when I first got into Autoit and I was doing purely keyboard commands for automation.  In your case the + key should check the box and the tab key can tab down to its location. 

+ is not going to uncheck it (like Space would) so its safe to use without knowing its state ahead of time.

Edited by ViciousXUSMC

Share this post

Link to post
Share on other sites

Hey Everyone,

           Thank you for all the help.  After much testing yesterday, the only thing that worked was the Send Command,   Tab to the correct option, Send a + key. Puts a check mark in that box every time no matter if the box is checked or unchecked.

Sleep (4000)
Sleep (1000)

This is what is working for me.   

Again many thanks for pointing me in the right direction.

Share this post

Link to post
Share on other sites

Yeah sometimes simpler is better, I have had no issues doing long automations purely with key inputs.

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


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.