xcaliber13 Posted June 8, 2015 Share Posted June 8, 2015 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 Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 8, 2015 Share Posted June 8, 2015 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. Link to comment Share on other sites More sharing options...
232showtime Posted June 9, 2015 Share Posted June 9, 2015 (edited) 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 Boxmaybe something is wrong with control command Checked, IsChecked and UnChecked Edited June 9, 2015 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 9, 2015 Share Posted June 9, 2015 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. https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm Also "ischecked" is properly working for me.$test = ControlCommand("Notepad++ v6.7.8.2 Setup", "", 1200, "IsChecked") MsgBox(0, "", $test) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 9, 2015 Moderators Share Posted June 9, 2015 232showtime,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.M23 232showtime 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
232showtime Posted June 9, 2015 Share Posted June 9, 2015 I do not even see what you used "Checked" in the command list. https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htmtypo error, whats with the 1200 value? ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 9, 2015 Share Posted June 9, 2015 (edited) 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 June 9, 2015 by ViciousXUSMC Link to comment Share on other sites More sharing options...
xcaliber13 Posted June 9, 2015 Author Share Posted June 9, 2015 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.WinActive("ClientWare") Sleep (4000) Send("{TAB}{TAB}{TAB}{TAB}") Sleep (1000) Send("{+}")This is what is working for me. Again many thanks for pointing me in the right direction. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 9, 2015 Share Posted June 9, 2015 Yeah sometimes simpler is better, I have had no issues doing long automations purely with key inputs. 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