Last active
March 29, 2022 19:10
-
-
Save 0x4a/5932300 to your computer and use it in GitHub Desktop.
use total commander script content plugin with autohotkey scriptsplace files in directory of installed script.wdx, add columns with "[=script.Result]" which will show line number of files - counted by ahk script #totalcmd #ahk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; requires WinScript Advanced Content Plugin for Total Commander: http://totalcmd.net/plugring/WinScriptAdv.html | |
#NoEnv | |
#NoTrayIcon | |
FileEncoding UTF-8 | |
SetBatchLines,-1 | |
file = %filename% | |
; find file | |
if FileExist(file) | |
{ | |
; check size | |
FileGetSize, fileSize, %file% | |
if (fileSize < 1000000) | |
{ | |
returnValue := countLines(file) | |
} | |
else | |
{ | |
returnValue := "---" | |
} | |
} | |
else if StrLen(file) = 0 | |
{ | |
; missing argument | |
returnValue := -1 | |
} | |
else | |
{ | |
; file not found | |
returnValue := -1 | |
} | |
;Msgbox, (%returnValue%) %file% | |
if (returnValue = "" or returnValue = -1) { | |
content = 0 | |
} else { | |
content = %returnValue% | |
} | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; file functions | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; return number of lines | |
countLines(file) | |
{ | |
Loop, read, %file% | |
lineCount := A_Index | |
return lineCount | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Lines] | |
Script=lines.ahk | |
content=Number of lines | |
extensions=* | |
FoldersPaths=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment