Learn To Program Using FREE Tools with AutoIt 1.2

   (2 reviews)

1 Screenshot

About This File

I wrote an introductory text for new programmers to learn how to code using AutoIt.   It follows along with the help file for the most part – but provides additional context and attempts to connect all the information in a cohesive way for someone without any programming experience.  I find the help file to be an AMAZING resource and the text I wrote in no way reflects any opinion to the contrary.  Rather, it was created from the perspective of someone who struggled early on with the most basic concepts and thought that a hand-holding guide could be useful.  I was also inspired by code.org who is trying to encourage people to learn to code.  I thought – what better way than to use free tools that you can download at any time with access to an amazing community?  If only there was a guide to walk people through it …

Full discussion about the file can be found here: https://www.autoitscript.com/forum/topic/174205-introductory-learn-to-program-text-using-au3/


What's New in Version 1.2

Released

*UPDATED VERSION* Gutted images to reflect use of MsgBox constants instead of empty string.  Incorporated numerous edits from forum members.  Added appendix containing all code samples.

I wrote an introductory text for new programmers to learn how to code using AutoIt.   It follows along with the help file for the most part – but provides additional context and attempts to connect all the information in a cohesive way for someone without any programming experience.  I find the help file to be an AMAZING resource and the text I wrote in no way reflects any opinion to the contrary.  Rather, it was created from the perspective of someone who struggled early on with the most basic concepts and thought that a hand-holding guide could be useful.  I was also inspired by code.org who is trying to encourage people to learn to code.  I thought – what better way than to use frees tools that you can download at any time with access to an amazing community?  If only there was a guide to walk people through it …


7 people like this



User Feedback

You may only provide a review once you have downloaded the file.


TheDcoder

  • 5
   3 of 3 members found this review helpful 3 / 3 members

Awesome Book! Worth reading if you have 0 experience in programming! Keep up the good work jfish! :thumbsup:

2 people like this

Share this review


Link to review
0uwe

  • 5
   1 of 1 member found this review helpful 1 / 1 member

I like it,a'm just started with autoit,so a get al de information a can get.This a good beginning usefull i find. Thanks Jfish

1 person likes this

Share this review


Link to review
  • Similar Content

    • OldGuyWalking
      Dummy Control Not Triggering
      By OldGuyWalking
      I wanted a quick way to identify screen coordinates and created a simple form.  I also wanted to collect the information. Goal was to move the mouse to different locations, hit a key combination and have the program  collect info for that position and write it to a file.
      I couldn't use a button on the form and HotKeys was not recommended (according to some posts I'd read on here).
      I discovered GUIAccelerators but I'm stuck on what triggers the accelerator key.  I've looked at the help file for GUISetAccelerators which references GUICtrlCreateDummy and used the code from both of those.  I'm not getting any errors and everything seems to run okay except when I press Ctrl + [F3] nothing is captured. 
      This is a work in progress so there's extra code that I haven't cleaned up yet.
      Any help would be appreciated. 
      Bill
      ; Displays the Window Handle, Window Text, Control Handle, and mouse position. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=Y #AutoIt3Wrapper_Res_Comment=Show screen coordinates. #AutoIt3Wrapper_Res_Description=Show screen coordinates. #AutoIt3Wrapper_Res_Fileversion=0.0.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> Global $Debug = 0 Dim $sWinTitle Dim $sWinText Dim $sWinHnd Dim $sWinCtrlRef Dim $sWinCtrlText Dim $sWinCtrlHnd Dim $aPos Dim $mPos Dim $sMousePos Dim $sControlPos Dim $iFile Dim $sFileLogName = @WorkingDir & "\WinfoFile" & @YDAY & ".log" Dim $sReport ; HotKeySet("!{Esc}", "Terminate") ; HotKeySet("!{F3}", "WriteLogFile") #Region ### START Koda GUI section ### Form=F:\AutoIT Apps\Misc Mini Utilities\Coordinates\Coordinates.kxf Global $Coordinates = GUICreate("Coordinates", 340, 225, 1, 750, -1, $WS_EX_TOPMOST) Global $lblXPos = GUICtrlCreateLabel("XPos:", 7, 16, 39, 20, $SS_RIGHT) Global $XPos = GUICtrlCreateLabel("XPos", 95, 16, 36, 20, $SS_RIGHT) Global $lblYPos = GUICtrlCreateLabel("YPos:", 7, 34, 40, 20, $SS_RIGHT) Global $YPos = GUICtrlCreateLabel("YPos", 95, 34, 37, 20, $SS_RIGHT) Global $lblWinTitle = GUICtrlCreateLabel("Window Title:", 7, 61, 84, 20, $SS_RIGHT) Global $WinTitle = GUICtrlCreateLabel("WinTitle", 95, 61, 250, 20) Global $lblHandle = GUICtrlCreateLabel("Handle:", 7, 78, 51, 20, $SS_RIGHT) Global $WinHandle = GUICtrlCreateLabel("Win Handle", 95, 78, 100, 20) Global $lblCtrlID = GUICtrlCreateLabel("Control ID:", 7, 104, 65, 20, $SS_RIGHT) Global $ControlID = GUICtrlCreateLabel("ControlID", 95, 104, 100, 20) Global $lblCtrlText = GUICtrlCreateLabel("Control Text:", 7, 125, 78, 20, $SS_RIGHT) Global $ControlText = GUICtrlCreateLabel("Control Text", 95, 125, 120, 20) Global $lblCtrlPos = GUICtrlCreateLabel("Control Pos:", 7, 144, 76, 20, $SS_RIGHT) Global $ControlPos = GUICtrlCreateLabel("Control Pos", 95, 144, 73, 20) Global $btnExit = GUICtrlCreateButton("Exit", 8, 192, 75, 25) Global $sKey1 = GUICtrlCreateDummy() ; Set GUIAccelerators for the button controlID Ctrl + [F3] Global $aAccelKeys[1][2] = [["^{F3}", $sKey1]] GUISetAccelerators($aAccelKeys) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If $nMsg <> 0 Then ConsoleWrite("GUIGetMsg = " & $nMsg & @CRLF) ConsoleWrite("$sKey1 = " & $sKey1 & @CRLF) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE If $nMsg <> 0 Then ConsoleWrite("Event Close = " & $nMsg & @CRLF) EndIf Exit Case $btnExit If $nMsg <> 0 Then ConsoleWrite("Terminate = " & $nMsg & @CRLF) EndIf Terminate() Case $sKey1 If $nMsg <> 0 Then ConsoleWrite("Report = " & $nMsg & @CRLF) EndIf $iFile = FileOpen($sFileLogName, 1) If $iFile = -1 Then MsgBox(0, "Error", "Unable to Open WinfoFile") EndIf $sWinTitle = WinGetTitle("", "") $sWinText = WinGetText($sWinTitle) $sWinHnd = WinGetHandle($sWinTitle) $sWinCtrlRef = ControlGetFocus($sWinHnd) $sWinCtrlText = ControlGetText($sWinHnd, "", $sWinCtrlRef) $sWinCtrlHnd = ControlGetHandle($sWinHnd, "", $sWinCtrlRef) ControlFocus($sWinHnd, "", $sWinCtrlRef) $aPos = ControlGetPos($sWinCtrlHnd, "", $sWinCtrlRef) $mPos = MouseGetPos() If IsString($sWinText) Then GUICtrlSetData($WinTitle, $sWinTitle) Else GUICtrlSetData($WinTitle, "") EndIf If IsHWnd($sWinHnd) Then GUICtrlSetData($WinHandle, $sWinHnd) Else GUICtrlSetData($WinHandle, "") EndIf GUICtrlSetData($ControlID, $sWinCtrlRef) GUICtrlSetData($ControlText, $sWinCtrlText) If IsArray($aPos) Then GUICtrlSetData($ControlPos, $aPos[0] & "," & $aPos[1]) $sControlPos = $aPos[0] & "," & $aPos[1] Else GUICtrlSetData($ControlPos, "") $sControlPos = "" EndIf If IsArray($mPos) Then GUICtrlSetData($XPos, $mPos[0]) GUICtrlSetData($YPos, $mPos[1]) $sMousePos = $mPos[0] & "," & $mPos[1] Else GUICtrlSetData($XPos, "") GUICtrlSetData($YPos, "") $sMousePos = "" EndIf $sReport = $sReport & "Window Title : " & $sWinTitle & @CRLF $sReport = $sReport & "Window Text : " & $sWinText & @CRLF $sReport = $sReport & "Window Handle : " & $sWinHnd & @CRLF $sReport = $sReport & "Control Refer : " & $sWinCtrlRef & @CRLF $sReport = $sReport & "Control Text : " & $sWinCtrlText & @CRLF $sReport = $sReport & "Control Handle : " & $sWinCtrlHnd & @CRLF $sReport = $sReport & "Control Position : " & $sControlPos & @CRLF $sReport = $sReport & "Mouse Position : " & $sMousePos & @CRLF If $Debug = 1 Then ConsoleWrite($sReport & @CRLF) EndIf FileWriteLine($iFile, "=====================================================") FileWriteLine($iFile, $sReport) FileWriteLine($iFile, "=====================================================") FileClose($iFile) If @error = -1 Then MsgBox(0, "Error", "Failed") Else MsgBox(0, "Report", "Report Completed") EndIf EndSwitch $sWinTitle = WinGetTitle("", "") $sWinText = WinGetText($sWinTitle) $sWinHnd = WinGetHandle($sWinTitle) $sWinCtrlRef = ControlGetFocus($sWinHnd) $sWinCtrlText = ControlGetText($sWinHnd, "", $sWinCtrlRef) $sWinCtrlHnd = ControlGetHandle($sWinHnd, "", $sWinCtrlRef) ControlFocus($sWinHnd, "", $sWinCtrlRef) $aPos = ControlGetPos($sWinCtrlHnd, "", $sWinCtrlRef) $mPos = MouseGetPos() If IsString($sWinText) Then GUICtrlSetData($WinTitle, $sWinTitle) Else GUICtrlSetData($WinTitle, "") EndIf If IsHWnd($sWinHnd) Then GUICtrlSetData($WinHandle, $sWinHnd) Else GUICtrlSetData($WinHandle, "") EndIf GUICtrlSetData($ControlID, $sWinCtrlRef) GUICtrlSetData($ControlText, $sWinCtrlText) If IsArray($aPos) Then GUICtrlSetData($ControlPos, $aPos[0] & "," & $aPos[1]) $sControlPos = $aPos[0] & "," & $aPos[1] Else GUICtrlSetData($ControlPos, "") $sControlPos = "" EndIf If IsArray($mPos) Then GUICtrlSetData($XPos, $mPos[0]) GUICtrlSetData($YPos, $mPos[1]) $sMousePos = $mPos[0] & "," & $mPos[1] Else GUICtrlSetData($XPos, "") GUICtrlSetData($YPos, "") $sMousePos = "" EndIf ;Sleep(500) WEnd Func WriteLogFile() Local $iFile Local $sFileLogName Local $sReport $sFileLogName = @WorkingDir & "\WinfoFile" & @YDAY & ".log" $iFile = FileOpen($sFileLogName, 1) If $iFile = -1 Then MsgBox(0, "Error", "Unable to Open WinfoFile") Return -1 EndIf $sReport = $sReport & "Window Title : " & $sWinTitle & @CRLF $sReport = $sReport & "Window Text : " & $sWinText & @CRLF $sReport = $sReport & "Window Handle : " & $sWinHnd & @CRLF $sReport = $sReport & "Control Refer : " & $sWinCtrlRef & @CRLF $sReport = $sReport & "Control Text : " & $sWinCtrlText & @CRLF $sReport = $sReport & "Control Handle : " & $sWinCtrlHnd & @CRLF $sReport = $sReport & "Control Position : " & $aPos[0] & "," & $aPos[1] & @CRLF $sReport = $sReport & "Mouse Position : " & $mPos[0] & "," & $mPos[1] & @CRLF FileWriteLine($iFile, "=====================================================") FileWriteLine($iFile, $sReport) FileWriteLine($iFile, "=====================================================") FileClose($iFile) MsgBox(0, "Report", "Report Completed") Return EndFunc ;==>WriteLogFile ;====================================================================================== ; Function: Terminate Hot Key = Alt+Esc ;====================================================================================== Func Terminate() ; Hot Key = Alt+Esc GUIDelete($Coordinates) Exit 0 EndFunc ;==>Terminate  
    • newcoding
      Generating Unique Combinations From Fixed Data
      By newcoding
      #include <Excel.au3> #include <File.au3> #include <String.au3> #include <Array.au3> Local $sku_array[0] ;13640 Local $name_array[0] ;13640 Local $sku_string Local $name = "Name Here"; hardcoded, iterate through final list Local $name_sku = "E001" ; hardcoded, iterate through final list For $size = 0 to 3 Step 1 For $mg = 0 to 30 Step 1 For $b = 0 to 1 Step 1 For $menthol = 0 to 4 Step 1 For $vg = 0 to 10 Step 1 $sku_string = String($name_sku & $size & $mg & $b & $menthol & $vg) _ArrayAdd($sku_array, $sku_string) _ArrayAdd($name_array, $name) Next Next Next Next Next ;_ArrayDisplay($name_sku_array, "Array Data:") Local $oExcel = _Excel_Open() Local $sWorkbook = @ScriptDir & "\FURLS_TRLM_Product_Listing_Eliquid.xls" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, Default, Default, True) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $sku_array, "B2:B13641") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $name_array, "J2:J13641") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $name_array, "A2:A13641") ;A2 or Column 1 - $name_string ;B2 or Column 2 - $sku_string ;J2 or Column 10 - $name_string So I am trying to generate every unique combination using 1 value from each set and then place each generated value into an array and then write to an excel sheet.
      Edit: Functional Code, F#CK THE FDA!
       
      I have the following data sets:
      Size: 10, 30, 50, 100
      MG: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30  (shortened in the above code for time constraints while testing)
      VG: 0,1,2,3,4,5,6,7,8,9,10
      Boost: 0,1
      Menthol: 0,1,2,3,4
    • afallenhope
      AutoitExe not working on Win 10
      By afallenhope
      Hello all! 
      I am having a bit of trouble and was wondering if anyone may have a workaround for my issue. I made a script that would automatically install a piece of software each night on a Windows 7 Box. Now I have been instructed to do the same with a Windows 10 box since the application is now being tested on Windows 10. 
      The way I did the win7 installation was that I made a script and then made an executable that I call with a batch file along with the Installer. So the process is 
      AutoitMainFile calls batch file, batch file opens Installer, and the automatedinstaller.exe  The automatedinstlaller waits 10-20 seconds to make sure the Installer has been fully loaded.
      When I try to do the same both get loaded but the automatedinstallation.exe does not send commands to the installer. The code does work and nothing from the program we are wanting to install has changed as our Windows 7 runs every night no problem. 
       
      Do I need to make a new automatedinstall script for windows 10? 
      Any advice is appreciated 
      Thanks,
      Richard
    • aa2zz6
      Load program from CMD
      By aa2zz6
      I have a .ini file that holds my path for our mapping software. I can't seem to get the CMD function to read the file path. I removed everything but the file path but it doesn't work.
      [ArcGIS Desktop]
      Path=C:\Users\<user name>\AppData\Local\ESRI\Desktop10.1\Launcher.exe
      Local Const $sFilePath = @ScriptDir & "\Mapping\Path\ " & "Path" & ".ini" Local $sFilewrite = IniWrite($sFilePath, "ArcGIS Desktop", "Path=", "C:\Users\aa2zz6\AppData\Local\ESRI\Desktop10.1\Launcher.exe") Start() Func Start() $MyCommand = $sFilewrite Run(@ComSpec & " /c " & $MyCommand, @SystemDir, @SW_HIDE) EndFunc ;==>Start  
    • aa2zz6
      Include/Calling scripts from sub directories
      By aa2zz6
      I have a folder that holds a main script. In the main folder I have sub folders with scripts that include certain functions. How do I access the scripts in the sub folders.
      I can assume @ScriptDir wouldn't work with include to search the current folder?  
      #Include "file.au3"