vidim Posted April 14, 2015 Share Posted April 14, 2015 (edited) Hi all. Basically I am a total beginner at this. I know a fair bit of HTML, CSS, iMacros, and I can probably meddle with other people's PHP. I have just begun to learn this thing, cause I want something with a GUI, that can help me launch many different iMacros instances. The regular way of doing this in iMacros, with a batch file, just don't cut it for me. I have downloaded Koda Form Designer cause it is WYSIWYG and it is supposed to integrate with AutoIT. What I want to do; I have a GUI with many different check boxes and one SUBMIT button. I want each checkbox to have an EXE (or BAT) assigned, and have all those EXEs checked with the check box to start simultaneously when I click the submit. For the sake of this discussion, let us pretend that these are the EXEs; Run("one.exe") Run("two.exe") Run("three.exe") And this is the GUI design as it comes from the Koda Form Designer #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 1217, 443, 198, 219) $Checkbox1 = GUICtrlCreateCheckbox("ONE", 8, 64, 49, 33) $Checkbox2 = GUICtrlCreateCheckbox("TWO", 8, 88, 41, 25) $Checkbox3 = GUICtrlCreateCheckbox("THREE", 8, 112, 49, 17) $Button1 = GUICtrlCreateButton("SUBMIT", 16, 192, 169, 57, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd So how do I link a certain EXE to a certain checkbox and have one of them, or all of them, start at the click of SUBMIT? Thank you for reading this. Please note that if you decide to answer, and don't dumb the answer down, I might not get it. Edited April 14, 2015 by vidim Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2015 Share Posted April 14, 2015 Welcome to AutoIt! You were close :-) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 1217, 443, 198, 219) $Checkbox1 = GUICtrlCreateCheckbox("ONE", 8, 64, 49, 25) $Checkbox2 = GUICtrlCreateCheckbox("TWO", 8, 88, 49, 25) $Checkbox3 = GUICtrlCreateCheckbox("THREE", 8, 112, 49, 25) $Button1 = GUICtrlCreateButton("SUBMIT", 16, 192, 169, 57, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If IsChecked($Checkbox1) Then MsgBox(0,'Run','1') ; Run("one.exe") If IsChecked($Checkbox2) Then MsgBox(0,'Run','2') ; Run("two.exe") If IsChecked($Checkbox3) Then MsgBox(0,'Run','3') ; Run("three.exe") EndSwitch WEnd Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
vidim Posted April 14, 2015 Author Share Posted April 14, 2015 Thanks Zedna. That only gives me a MSGBOX popping up, even with the default notepad.exe as chose exe. I do appreciate you taking me this far though. I am sure I can work it out from here, now that you gave me the starting blocks. I'll be trying it out when I wake up. Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2015 Share Posted April 14, 2015 (edited) At the end of line is commented Run() instead of MsgBox() Just remove MsgBox() and uncomment Run() ... If IsChecked($Checkbox1) Then Run("one.exe") Edited April 14, 2015 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
vidim Posted April 14, 2015 Author Share Posted April 14, 2015 Thanks. Works like a dream. Nice little thing this, Autoit Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2015 Share Posted April 14, 2015 Nice little thing this, Autoit Yes. I agree TheDcoder 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
TheDcoder Posted April 15, 2015 Share Posted April 15, 2015 @Zedna Me too EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion 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