Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/13/2023 in all areas

  1. ioa747

    TreeStructureDir

    Structure of a folder in text, with tree format for a more visually improved format TreeStructureDir.au3 ; https://www.autoitscript.com/forum/topic/211237-treestructuredir ;---------------------------------------------------------------------------------------- ; Title...........: TreeStructureDir.au3 ; Description.....: Structure of a folder in text, with tree format for a more visually improved format ; AutoIt Version..: 3.3.16.1 Author: ioa747 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <File.au3> #include <Array.au3> Global $sPath = "C:\Program Files (x86)\AutoIt3" Global $sTxt = TreeStructureDir($sPath) ConsoleWrite($sPath & @CRLF & $sTxt & @CRLF) ;---------------------------------------------------------------------------------------- Func TreeStructureDir($sDirectoryPath) Local $aFolders, $iColCnt, $aSplit, $Result $aFolders = _FileListToArrayRec($sDirectoryPath, "*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT) If @error Then Return SetError(@error, @extended, "") $iColCnt = 0 _ArrayColInsert($aFolders, 1) For $i = 1 To $aFolders[0][0] $aSplit = StringSplit($aFolders[$i][0], "\") If $aSplit[0] > $iColCnt Then $iColCnt = $aSplit[0] Next For $i = 1 To $iColCnt - 1 _ArrayColInsert($aFolders, 1) Next For $i = 1 To $aFolders[0][0] $aSplit = StringSplit($aFolders[$i][0], "\") For $x = 1 To $aSplit[0] $aFolders[$i][$x] = $aSplit[$x] Next Next $iColCnt = UBound($aFolders, 2) - 1 For $i = 1 To $aFolders[0][0] For $x = $iColCnt To 1 Step -1 If StringLen($aFolders[$i][$x]) > 0 Then If $aFolders[$i][$x] = $aFolders[0][$x] Then $aFolders[$i][$x] = "│ " Else $aFolders[0][$x] = $aFolders[$i][$x] If $x > 1 Then If $i < $aFolders[0][0] Then If $aFolders[$i][$x - 1] = $aFolders[$i + 1][$x - 1] Then $aFolders[$i][$x] = "├─ " & $aFolders[0][$x] Else $aFolders[$i][$x] = "└─ " & $aFolders[0][$x] EndIf Else $aFolders[$i][$x] = "└─ " & $aFolders[0][$x] EndIf Else $aFolders[$i][$x] = "├─ " & $aFolders[0][$x] EndIf EndIf Else $aFolders[0][$x] = "" EndIf Next Next For $i = $aFolders[0][0] To 1 Step -1 For $x = 1 To $iColCnt If $x = 1 And StringLen($aFolders[0][$x]) > 0 Then If $aFolders[$i][$x] = "│ " Then $aFolders[$i][$x] = " " If StringLeft($aFolders[$i][$x], 3) = "├─ " Then $aFolders[$i][$x] = StringReplace($aFolders[$i][$x], "├─ ", "└─ ") $aFolders[0][$x] = "" EndIf EndIf If StringLen($aFolders[$i][$x]) = 0 Then $aFolders[0][$x] = ":FIX:" If $aFolders[0][$x] = ":FIX:" Then If $aFolders[$i][$x] = "│ " Then $aFolders[$i][$x] = " " ElseIf $aFolders[$i][$x] = "" Then ;nothing Else $aFolders[0][$x] = "" EndIf If StringLeft($aFolders[$i][$x], 3) = "├─ " Then $aFolders[$i][$x] = StringReplace($aFolders[$i][$x], "├─ ", "└─ ") $aFolders[0][$x] = "" EndIf EndIf Next Next For $i = 1 To $aFolders[0][0] For $x = 1 To $iColCnt $Result &= $aFolders[$i][$x] Next $Result &= @CRLF Next ;~ _ArrayDisplay($aFolders) Return BinaryToString(StringToBinary($Result, 4), 4) EndFunc ;==>TreeStructureDir ;---------------------------------------------------------------------------------------- Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    2 points
  2. As I mentioned below, I did not include that script/exe. However, I have shown a copy of the log messages from its execution and given a description of what it does. I intentionally included the compiled example script (Chilkat_SxS_Test.exe) because, without my manifest tool, you wouldn't be able to compile the example script with the "run_after" directive. To be clear, even without my manifest tool, I provided everything needed to recreate the compiled exe that uses an sxs manifest (except for a script or tool like ResourceHacker that will let you read & delete the compiled exe's internal manifest). That's why I went into so much detail about what it does. If you have additional questions about my manifest tool and what it does, feel free to ask. No, my SxS_RegisterFree_COM_Manifest_Tool is not needed. As I said before, it just automates the 4 manual steps I previously described. Again, you can refer to the log file that I posted from my manifest tool to see exactly what it does at a high-level. However, as I also mentioned, you can use ResourceHacker or a similar tool to manually accomplish some of the same tasks. I would strongly suggest using ResourceHacker (or a similar tool) so you can see exactly what is pulled & deleted from the original compiled exe and how it relates to the contents of the sxs manifest. Once you see and understand how to manually create the sxs manifest, it's much easier to automate that process, if you even want or need to automate that process. Which of the steps that I've previously described would you like for me to try and help you gain a better understanding of? The reason I made the sxs example using the Chilkat dll is because you said that you're familiar with. If you would like help with a different Dll, then either post it, provide a link to it, or send it to me in a PM (if it is something you'd rather not post in the public forum). I will take a look at it and see if I can help you understand the steps necessary to create an sxs manifest for it.
    1 point
  3. Gianni

    TreeStructureDir

    just for fun, here's an alternative 'shortened' version ; https://www.autoitscript.com/forum/topic/211237-treestructuredir ;---------------------------------------------------------------------------------------- ; Title...........: TreeStructureDir.au3 ; Description.....: Structure of a folder in text, with tree format for a more visually improved format ; AutoIt Version..: 3.3.16.1 Author: ioa747 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Global $sPath = "C:\Program Files (x86)\AutoIt3" Global $sTxt = TreeStructureDir($sPath) ConsoleWrite($sPath & @CRLF & $sTxt & @CRLF) ;---------------------------------------------------------------------------------------- Func TreeStructureDir($sDirectoryPath) Local $sTree = '', $iPID = Run(@ComSpec & ' /c tree "' & $sDirectoryPath & '" /A', '', @SW_HIDE, 8) While ProcessExists($iPID) $sTree &= StdoutRead($iPID) WEnd Return $sTree EndFunc ;==>TreeStructureDir ;----------------------------------------------------------------------------------------
    1 point
  4. Then I guess you have change the Open for AU3 files from Run to Edit? Check the default settings in SciTE, start au3Config, select Other tools, run AutoIt3/SciTE check. The will generate a report of your current installation and setting for au3 in the registry.
    1 point
  5. #include <array.au3> Local $sFile , $sString , $aAry $sFile = @ScriptDir & '\The.Girl-UTF.srt' $sString = _ReadFile($sFile) $aAry = StringRegExp($sString,'(?is)\d+\r?\n\d{2}:\d{2}:\d{2},\d+\V+.+?(?=\r?\n\r?\n|$)',3) If Not @error Then _ArrayDisplay($aAry , $sFile) $sFile = @ScriptDir & '\The.Girl2-ANSI.srt' $sString = _ReadFile($sFile) $aAry = StringRegExp($sString,'(?is)\d+\r?\n\d{2}:\d{2}:\d{2},\d+\V+.+?(?=\r?\n\r?\n|$)',3) If Not @error Then _ArrayDisplay($aAry , $sFile) Func _ReadFile($sFile) Local $sRet Local $hFile = FileOpen($sFile , FileGetEncoding($sFile)) $sRet = FileRead($hFile) FileClose($hFile) Return $sRet EndFunc
    1 point
  6. The registry key does not exist in my machine but the set_dark_theme function works. Saludos
    1 point
  7. ioa747

    TreeStructureDir

    thank you very much, I already adopted it
    1 point
  8. argumentum

    TreeStructureDir

    Love it !. Thanks for sharing
    1 point
  9. Hi, #include <Constants.au3> Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetClick(18) Global $Tray[11], $state = 2 TrayCreateItem("") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "TrayEvent") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "TrayMenuLeftClick") TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "TrayMenuRightClick") TraySetState() While 1 Sleep(100) WEnd Func TrayMenuLeftClick() If $state = 0 Or $state = 2 Then $state = 1 For $i = 6 to 10 TrayItemDelete($Tray[$i]) Next For $i = 1 to 5 $Tray[$i] = TrayCreateItem("1st Menu Item - " & $i, -1, $i -1 ) TrayItemSetOnEvent(-1, "TrayEvent") Next EndIf EndFunc Func TrayMenuRightClick() If $state = 1 Or $state = 2 Then $state = 0 For $i = 1 to 5 TrayItemDelete($Tray[$i]) Next For $i = 6 to 10 $Tray[$i] = TrayCreateItem("2nd Menu Item - " & $i - 5, -1, $i - 6) TrayItemSetOnEvent(-1, "TrayEvent") Next EndIf EndFunc Func TrayEvent() MsgBox(0, "", TrayItemGetText(@TRAY_ID)) If TrayItemGetText(@TRAY_ID) = "Exit" Then Exit EndFunc Cheers
    1 point
×
×
  • Create New...