Leaderboard
Popular Content
Showing content with the highest reputation on 05/11/2023 in all areas
-
GuiBuilderPlus [updated March 24, 2024]
Skeletor and one other reacted to kurtykurtyboy for a topic
Updated zip in the first post with a couple bug fixes and updates. I created my own sort of build process to streamline new releases, so let me know if I missed anything in the zip. FIXED: Bug when resizing the Code Generation window FIXED: Bug control randomly disappears FIXED: More seamless positioning of resize handles when crossing zero FIXED: Code preview was not always updating ADDED: New property "Image" for Icon and Pic controls with selection dialog UPDATED: Smaller tab width in code preview2 points -
GuiBuilderPlus [updated March 24, 2024]
yahaosoft reacted to kurtykurtyboy for a topic
GuiBuilderPlus GuiBuilderPlus is a small, easy to use GUI designer for AutoIt. Originally created long ago as AutoBuilder by the user CyberSlug, enhanced as GuiBuilder by TheSaint, and further enhanced and expanded as GuiBuilderNxt by jaberwacky, GuiBuilderPlus is a continuation of their great work, with a focus on increased stability and usability followed by new features. ------ Yes, I have decided to bring back our old friend the GuiBuilder. This utility has a long history, which you can read about in TheSaint's Gui Creators topic, starting all the back back with CyberSlug's AutoBuilder. Even though I've hacked the original code to pieces in order to document and better understand what is going on, the essence of GuiBuilder still lives on! I am using the awesome updates from GuiBuilderNxt by jaberwacky as a starting point since he already did a lot of the hard work of parsing and updating the original code, plus I really like the layout that came about from that update. Unfortunately development seems to have stopped in 2016. Not sure how much interest there is in this, but suggestions and bug reports are welcome. See Full Changelog: Download the latest version: v1.3.0 (2024-03-24) GuiBuilderPlus v1.3.0 - 2024-03-24.zip FIXED: Wrong line endings when copying from code preview window FIXED: Issue changing properties when Obect Explorer window is not open FIXED: Issue when selecting controls under certain other conditions FIXED: SaveAs keyboard shortcut FIXED: Undo/Redo for Global property ADDED: Auto-size property for Labels, Buttons, and Inputs GitHub Repository: https://github.com/KurtisLiggett/GuiBuilderPlus1 point -
in the beginning I also did it like this for better alignment. but I changed it because in the Datalar.txt it has 1 digit it's still there, just as a comment on line 55 and 231 change from ;~ ; format date 00.00.0000 for ini FileName ;~ $aSpl = StringSplit($sDate, ".") ;~ If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1] ;~ $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini" $IniFile = $sDate & ".ini" to ; format date 00.00.0000 for ini FileName $aSpl = StringSplit($sDate, ".") If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1] $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini" ;~ $IniFile = $sDate & ".ini"1 point
-
Txt split to ini file
pixelsearch reacted to ioa747 for a topic
I'm embedding the time difference calculation in the array to improve the gui redraw speed ; https://www.autoitscript.com/forum/topic/210069-txt-split-to-ini-file/?do=findComment&comment=1517679 #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 ;-w 5 -w 6 -w 7 #include <Misc.au3> #include <File.au3> #include <Date.au3> #include <Array.au3> #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> _Singleton(@ScriptName, 0) ToolTip(" File Splitting ", @DesktopWidth / 2, @DesktopHeight / 5, "Please wait...", 1) Global $nMsg, $hGui, $idCombo, $lv, $CurUser Global $aUsers = WriteAllUserData() Global $aData = FindAllIniFile(@ScriptDir & "\Data\") AddAbsentUser() MakeMyGuiList() HotKeySet("{HOME}", "aDataDisplay") ;Display the $aData Array HotKeySet("{END}", "aUsersDisplay") ;Display the $aUsers Array While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $idCombo _GUICtrlComboBox_GetLBText($idCombo, _GUICtrlComboBox_GetCurSel($idCombo), $CurUser) UpDadeMyGuiList($CurUser) Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd ;---------------------------------------------------------------------------------------- Func WriteAllUserData() ; Make all ini files Local $aDatalar, $aUsers, $UserName, $aTemp, $IniFile, $aSpl, $sDate _FileReadToArray("Datalar.txt", $aDatalar, $FRTA_NOCOUNT) _FileReadToArray("Users.txt", $aUsers, $FRTA_COUNT, "=") Local $iLines = UBound($aDatalar) $sDate = '' For $i = 0 To $iLines - 1 $aTemp = StringSplit($aDatalar[$i], ", ", $STR_NOCOUNT) $UserName = GetUserName($aUsers, $aTemp[1]) ; if no user skip If $UserName <> "" Then If $sDate <> $aTemp[3] Then $sDate = $aTemp[3] ;~ ; format date 00.00.0000 for ini FileName ;~ $aSpl = StringSplit($sDate, ".") ;~ If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1] ;~ $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini" $IniFile = $sDate & ".ini" ;write ini If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", "Non-existing key") = "Non-existing key" Then IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", $aTemp[1]) IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value02", $aTemp[3]) IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", $aTemp[4]) Else If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", "<UNKNOWN>") <> $aTemp[4] Then IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value04", $aTemp[4]) EndIf EndIf EndIf Next Return $aUsers EndFunc ;==>WriteAllUserData ;---------------------------------------------------------------------------------------- Func GetUserName($aUsers, $ID) ; ID to User Name Local $sName For $i = 1 To $aUsers[0][0] $sName = "" If $aUsers[$i][0] = $ID Then $sName = $aUsers[$i][1] ExitLoop EndIf Next Return $sName EndFunc ;==>GetUserName ;---------------------------------------------------------------------------------------- Func FindAllIniFile($sStartPath = "") ; Find All Ini File If $sStartPath = "" Then $sStartPath = @ScriptDir Local $aArray[1][8] $aArray[0][0] = 0 ; "index" $aArray[0][1] = "UserID" $aArray[0][2] = "UserName" $aArray[0][3] = "Date" $aArray[0][4] = "Start" $aArray[0][5] = "End" $aArray[0][6] = "Time" $aArray[0][7] = "idItem" Local $ArraySrtfiles = _FileListToArrayRec($sStartPath, "*.ini", $FLTAR_FILES, $FLTAR_RECUR) If Not IsArray($ArraySrtfiles) Then ConsoleWrite($sStartPath & " = Invalid input path" & @CRLF) Return Else For $x = 1 To $ArraySrtfiles[0] ;ConsoleWrite($sStartPath & $ArraySrtfiles[$x]& @CRLF) ReadIniToArray($aArray, $sStartPath & $ArraySrtfiles[$x]) Next Return $aArray EndIf EndFunc ;==>FindAllIniFile ;---------------------------------------------------------------------------------------- Func ReadIniToArray(ByRef $aArray, $TxtFile) ; Read Ini To Array Local $index ;Read the INI section names. This will return a 1 dimensional array. Local $aSections = IniReadSectionNames($TxtFile) ;Check if an error occurred. If Not @error Then ;Enumerate through the array displaying the section names. For $i = 1 To $aSections[0] ReDim $aArray[UBound($aArray) + 1][8] $aArray[0][0] += 1 $index = $aArray[0][0] $aArray[$index][0] = $index ;"index" $aArray[$index][1] = IniRead($TxtFile, $aSections[$i], "Value01", "Null") ;"UserID" $aArray[$index][2] = $aSections[$i] ;"UserName" $aArray[$index][3] = IniRead($TxtFile, $aSections[$i], "Value02", "Null") ;"Date" $aArray[$index][4] = IniRead($TxtFile, $aSections[$i], "Value03", "Null") ;"Start" $aArray[$index][5] = IniRead($TxtFile, $aSections[$i], "Value04", "Null") ;"End" $aArray[$index][6] = "" ;"Time" Next EndIf EndFunc ;==>ReadIniToArray ;---------------------------------------------------------------------------------------- Func MakeMyGuiList() ; GUI Create $hGui = GUICreate("_ank_ File Splitting", 510, 560, -1, -1) $lv = GUICtrlCreateListView("CART ID |DATE |START |END |TIME|NAME AND SURNAME", 10, 30, 490, 520) Local $sLine For $i = 1 To $aData[0][0] $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|" $sLine &= $aData[$i][5] & "|" & $aData[$i][6] & "|" & $aData[$i][2] $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv) If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][5] > "08:10:00" And $aData[$i][5] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][4] = "Null" Or $aData[$i][5] = "Null" Then GUICtrlSetBkColor(-1, 0xFFE5FF) Next $idCombo = GUICtrlCreateCombo("Select User", 10, 1, 490, 25) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") For $i = 1 To $aUsers[0][0] _GUICtrlComboBox_AddString($idCombo, $aUsers[$i][1]) Next GUISetState(@SW_SHOW) ToolTip("") EndFunc ;==>MakeMyGuiList ;---------------------------------------------------------------------------------------- Func UpDadeMyGuiList($Filter) ; delete items Local $hlv = GUICtrlGetHandle($lv) _GUICtrlListView_DeleteAllItems($hlv) Local $sLine ; ReMake items For $i = 1 To $aData[0][0] If $Filter = "Select User" Then $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|" $sLine &= $aData[$i][5] & "|" & $aData[$i][6] & "|" & $aData[$i][2] $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv) If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][5] > "08:10:00" And $aData[$i][5] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][4] = "Null" Or $aData[$i][5] = "Null" Then GUICtrlSetBkColor(-1, 0xFFE5FF) ContinueLoop Else If $aData[$i][2] = $Filter Then $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|" $sLine &= $aData[$i][5] & "|" & $aData[$i][6] & "|" & $aData[$i][2] $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv) If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][5] > "08:10:00" And $aData[$i][5] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $aData[$i][4] = "Null" Or $aData[$i][5] = "Null" Then GUICtrlSetBkColor(-1, 0xFFE5FF) Else $aData[$i][7] = "" EndIf EndIf Next EndFunc ;==>UpDadeMyGuiList ;---------------------------------------------------------------------------------------- Func AddAbsentUser() Local $sLine, $IniFile, $aSpl, $aArray = $aData ;*[Add Absent User to $aData Array Local $aDateUnique = _ArrayUnique($aArray, 3, 1) For $d = 1 To $aDateUnique[0] For $i = 1 To $aUsers[0][0] If _GetThis($aUsers[$i][0] & "-" & $aDateUnique[$d]) = -1 Then ConsoleWrite("- AddAbsentUser: " & $aDateUnique[$d] & " " & $aUsers[$i][0] & "-" & $aUsers[$i][1] & @CRLF) $aData[0][0] += 1 $sLine = $aData[0][0] & "|" & $aUsers[$i][0] & "|" & $aUsers[$i][1] & "|" & $aDateUnique[$d] & "|Null|Null" _ArrayAdd($aData, $sLine) EndIf Next Next ;Add Absent User to $aData Array]* ;*[proper Array Sort order For $i = 1 To $aData[0][0] $aData[$i][6] = TimeDiff($aData[$i][4], $aData[$i][5]) ; format date YYYY.MM.DD.HH.MM.SS $aSpl = StringSplit($aData[$i][3], ".") If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1] $sLine = $aSpl[3] & "." & $aSpl[2] & "." & $aSpl[1] & "." & $aData[$i][4] $aData[$i][0] = $sLine Next _ArraySort($aData, 0, 1) For $i = 1 To $aData[0][0] $aData[$i][0] = $i Next ;proper Array Sort order]* ;*[Write $aData Array to ini For $i = 1 To $aData[0][0] ;~ ; format date 00.00.0000 for ini FileName ;~ $aSpl = StringSplit($aData[$i][3], ".") ;~ If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1] ;~ $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini" $IniFile = $aData[$i][3] & ".ini" ;write ini IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value01", $aData[$i][1]) IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value02", $aData[$i][3]) IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value03", $aData[$i][4]) IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value04", $aData[$i][5]) Next ;Write $aData Array to ini]* EndFunc ;==>AddAbsentUser ;---------------------------------------------------------------------------------------- Func _GetThis($Txt) Local $sIndex For $i = 1 To $aData[0][0] $sIndex = -1 If $aData[$i][1] & "-" & $aData[$i][3] = $Txt Then $sIndex = $i ExitLoop EndIf Next Return $sIndex EndFunc ;==>_GetThis ;---------------------------------------------------------------------------------------- Func TimeDiff($sStartTime, $sEndTime) Local $H, $M, $sDiff, $aSpl1, $aSpl2 $aSpl1 = StringSplit($sStartTime, ":") $aSpl2 = StringSplit($sEndTime, ":") If $aSpl1[0] + $aSpl2[0] <> 6 Then ;ConsoleWrite("! Error No valid time format" & @CRLF) Return SetError(1, 0, "") EndIf ; ** 2020/01/01 ** since all the results are from the same date $M = _DateDiff('n', "2020/01/01 " & $sStartTime, "2020/01/01 " & $sEndTime) $H = Floor($M / 60) $M = Mod($M, 60) $sDiff = StringFormat("%i:%02i", $H, $M) Return $sDiff EndFunc ;==>TimeDiff ;---------------------------------------------------------------------------------------- Func aDataDisplay() _ArrayDisplay($aData, "$aData") EndFunc ;==>MyArrayDisplay ;---------------------------------------------------------------------------------------- Func aUsersDisplay() _ArrayDisplay($aUsers, "$aUsers") EndFunc1 point -
So the conclusion Ineed tointegrate the Nine version which support the $bArray parameter Thanks to all of you1 point
-
Autoit + browser profiles
TendernessCup reacted to mLipok for a topic
As so far I found: https://www.proxyrack.com/blog/what-is-dolphin-anty-browser/ If this is chrome based .. IMO (note tested) you should be able to automate it with SetupChrome() the only change yous should to do is to manually add Capaiblity to point to desired browser EXE in stack sites here I found (as so far) the only one mention related to this browser and webdriver https://stackoverflow.com/questions/73522500/headless-mode-in-api-dolphin-anty-selenium EDIT: https://stackoverflow.com/questions/tagged/dolphin-browser EDIT2: https://stackoverflow.com/questions/74488576/how-to-automate-dolhin-anty-playwright-python1 point -
JSON UDF in pure AutoIt
TheDcoder reacted to AspirinJunkie for a topic
Thank you for the report. The case that an array element is to be deleted using this was simply not yet taken into account. I have uploaded the new version.1 point -
Here my take on it (seems SendMessage is slower) : #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListview GUICreate("ListView Get Selected Indices", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) _GUICtrlListView_AddColumn($idListview, "Column 1", 100) For $i = 0 To 10000 _GUICtrlListView_AddItem($idListview, "Item " & $i) Next GUISetState(@SW_SHOW) For $i = 0 To 10000 Step 5 _GUICtrlListView_SetItemSelected($idListview, $i) Next Local $hTimer = TimerInit() Local $aList = _GUICtrlListView_GetSelectedIndices_KAF(GUICtrlGetHandle($idListview)) ConsoleWrite("Kafu = " & TimerDiff($hTimer) & @CRLF) ;_ArrayDisplay($aList) $hTimer = TimerInit() $aList = _GUICtrlListView_GetSelectedIndices9($idListview, True) ConsoleWrite("Nine = " & TimerDiff($hTimer) & @CRLF) ;ConsoleWrite($aList & @CRLF) ;_ArrayDisplay($aList) $hTimer = TimerInit() $aList = _GUICtrlListView_GetSelectedIndices($idListview, True) ConsoleWrite("Jpm = " & TimerDiff($hTimer) & @CRLF) ;ConsoleWrite($aList & @CRLF) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>Example Func _GUICtrlListView_GetSelectedIndices9($hWnd, $bArray = False) Local $iCount = _GUICtrlListView_GetSelectedCount($hWnd) Local $aSelect[$iCount + 1] = [$iCount] If Not $iCount Then Return $bArray ? $aSelect : "" Local $iIdx = -1, $sIndices If IsHWnd($hWnd) Then $hWnd = _WinAPI_GetDlgCtrlID($hWnd) For $i = 1 To $iCount $iIdx = GUICtrlSendMsg($hWnd, $LVM_GETNEXTITEM, $iIdx, $LVNI_SELECTED) If $bArray Then $aSelect[$i] = $iIdx Else $sIndices &= $iIdx & "|" EndIf Next Return $bArray ? $aSelect : StringTrimRight($sIndices, 1) EndFunc ;==>_GUICtrlListView_GetSelectedIndices9 Func _GUICtrlListView_GetSelectedIndices_KAF($hWnd) Local $iSelectedCount = _GUICtrlListView_GetSelectedCount($hWnd) If $iSelectedCount Then Local $aIndices[$iSelectedCount + 1] $aIndices[0] = -1 ; -1 to find the first item that matches the specified flags (msdn) ; the specified item itself is excluded from the search (+++) For $i = 1 To $iSelectedCount $aIndices[$i] = _SendMessage($hWnd, $LVM_GETNEXTITEM, $aIndices[$i - 1], $LVNI_SELECTED) ; ConsoleWrite($i & @tab & $iEnum & @tab & $aIndices[0] & @crlf) Next $aIndices[0] = $iSelectedCount Else Local $aIndices[1] = [0] EndIf Return $aIndices EndFunc ;==>_GUICtrlListView_GetSelectedIndices_KAF Results with array : Kafu = 23.2122 Nine = 4.895 Jpm = 296.4108 Results with string : Nine = 4.6947 Jpm = 6.29711 point
-
Autoit + browser profiles
TendernessCup reacted to mLipok for a topic
Ok. But which exat ? InternetExplorer ? FireFox ? Google Chrome ? Edge ? Edge + IE Mode ? Opera ? ..... ???? And which version ? https://www.autoitscript.com/wiki/WebDriver did you try anything with AutoIt in this regards ? What did you try so far ? btw. to forum.1 point -
GuiBuilderPlus [updated March 24, 2024]
kurtykurtyboy reacted to Skeletor for a topic
This is found only in GuiBuilderPlus_formMain.au3 , correct?1 point -
AutoIt Snippets
BigDaddyO reacted to InunoTaishou for a topic
I was trying to make a downloader similar to Youtube Downloader and wanted to be able to grab urls from the clip board when I move my mouse inside the edit control (If you've used Youtube downloader you know what I'm talking about). I came up with this and it's a pretty nifty little snippit #include <GUIConstants.au3> #include <Memory.au3> #include <WinAPIShellEx.au3> #include <GuiEdit.au3> Global Enum $idProcEdit = 9999 Global $hMain = GUICreate("Capture clipboard in edit", 400, 400) GUICtrlCreateLabel("Move mouse over the edit control", 10, 10, 380, 20) Global $edtEdit = GUICtrlCreateEdit("Move mouse into edit", 10, 35, 380, 360) Global $hEdtEdit = GUICtrlGetHandle($edtEdit) Global $tPData = DllStructCreate("struct;char func[9];int iControl;endstruct") Global $hNewWindowProc = DllCallbackRegister(NewWindowProc, "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr") Global $pNewWindowProc = DllCallbackGetPtr($hNewWindowProc) $tPData.func = "Example" $tPData.iControl = $edtEdit _WinAPI_SetWindowSubclass($hEdtEdit, $pNewWindowProc, $idProcEdit, DllStructGetPtr($tPData)) GUISetState(@SW_SHOW, $hMain) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE _WinAPI_RemoveWindowSubclass($hEdtEdit, $pNewWindowProc, $idProcEdit) Exit 0 EndSwitch WEnd Func Example($idControl) Return GUICtrlSetData($idControl, GUICtrlRead($idControl) & @CRLF & ClipGet()) EndFunc Func NewWindowProc($hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData) #forceref $hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData Local Static $bInserted = False Switch ($uIdSubclass) Case $idProcEdit Switch ($iMsg) Case $WM_CHAR ; Ctrl + A, highlight all of the control that has focus If ($wParam = 1) Then Return _GUICtrlEdit_SetSel($hWnd, 0, -1) ; Mouse moved in the control or user did Ctrl + V Case $WM_MOUSEMOVE, $WM_PASTE If ($hWnd = $hEdtEdit And $bInserted = False) Then $bInserted = True Local $pData = DllStructCreate("struct;char func[64];int iControl;endstruct", $dwRefData) Return Call($pData.func, $pData.iControl) EndIf Case $WM_NCMOUSEMOVE $bInserted = False EndSwitch EndSwitch Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>NewWindowProc In my example I put a function to call associated with the edit control id in a struct and passed it to my window proc. This would let you call a specific function per control if you had multiple edit (or input boxes) that needed to do different things1 point