#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.12.0 Author: kcvinu Script Function: This program will paste your desired include file name into SciTE window Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include #include #include #include #include #include Opt("GUIOnEventMode", 1) Opt("WinTitleMatchMode", 2) Local $sFilePath = @ProgramFilesDir & "\AutoIt3\Include" ; This is the path of include folder Local $IncludeFileList = _FileListToArray($sFilePath, "*.au3") ; Filling array with file names _ArrayDelete($IncludeFileList,0) ; Deleting the first element of array, which is the count of array elements #Region ### START Koda GUI section ### Form= ; GUI part starts from here Global $Form1 = GUICreate("Includer", 200, 270, 700, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") Global $List1 = GUICtrlCreateList("", 8, 8, 190, 220) GUICtrlSetOnEvent(-1, "List1Click") Global $Button1 = GUICtrlCreateButton("Insert into SciTE", 30, 230, 139, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ListViewFiller() ; Calling ListviewFiller function While 1 Sleep(100) ; GUI in mainloop WEnd Func Button1Click() ; What to do when button is clicked Local $selectedItem = GUICtrlRead($List1) ; Getting the selected item from list box If $selectedItem = -1 Then ; If nothing is selected then MsgBox(0, "Includer", "Please select an item") ; Show a message Else If WinExists("SciTE") Then ; If something is selected then, check for SciTE window Local $SCITE_Title = WinGetTitle("[CLASS:SciTEWindow]") ; Getting the title of SciTE window Local $FinalOutput = "#include <" & $selectedItem & ">" ; Add the "#include" and "<>" string with filename WinActivate($SCITE_Title) ; Activate SciTE window Send($FinalOutput, 1) ; Paste the final output Else MsgBox(0, "Includer", "SciTE Editor is not running") ; If SciTE window is not running then, show a message EndIf EndIf EndFunc ;==>Button1Click Func Form1Close() Exit EndFunc ;==>Form1Close Func Form1Maximize() EndFunc ;==>Form1Maximize Func Form1Minimize() EndFunc ;==>Form1Minimize Func Form1Restore() EndFunc ;==>Form1Restore Func List1Click() EndFunc ;==>List1Click Func ListViewFiller() ; A function for filling list box For $i = 0 To (UBound($IncludeFileList) - 1) GUICtrlSetData($List1, $IncludeFileList[$i], "") Next EndFunc ;==>ListViewFiller