Here's an AHK "solution"
I don't seem to be able to modify TC's StatusBar or the Path String (to the left of the Command-Line), thus cannot do exactly as the original suggestion.
This could also be made to be auto-updating if needed (?)
I tend to prefer a calling via a HotKey or a Button on the Toolbar.
The output could be displayed in a Persistent or Temporary Tooltip or even in TC's TitleBar. Currently it displays (dumps the output) into the command-line.
The line
timeColumn = 2, would need to be updated to the appropriate Column that contains length/time data. My test Custom Column has the Length field as the 2nd column (after the filename/ext). Thus if it is not the 2nd column, then update that line accordingly.
The AHK script accepts time input as #h #m #s, OR #m #s, OR #:#:#, OR #:#
I didn't bother with plain-jane just a number field (i.e. seconds only)
Code: Select all
timeColumn = 2
outputMaxTime := "Mins"
;; outputMaxTime := "Hours"
IfWinNotActive, ahk_class TTOTAL_CMD
return
WinGet, aApp
PostMessage, 0x433, 2036, ,, A
fileList := Clipboard
hour := 0
mins := 0
secs := 0
ControlGetFocus, aControl, A
SetControlDelay, 0
Loop, Parse, fileList, `n
{
i := 1
tmpLine := A_LoopField
Loop, Parse, tmpLine, %A_Tab%
{
if( A_Index == timeColumn )
{
if( !RegExMatch( A_LoopField, "^()()(\d+)(m |:)(\d+)s?", tmpLine ))
RegExMatch( A_LoopField, "^(\d+)(h |:)(\d+)(m |:)(\d+)s?", tmpLine )
hour += tmpLine1 ? tmpLine1 : 0
mins += tmpLine3
secs += tmpLine5
}
}
}
mins += Floor( secs / 60 )
secs := Mod( secs, 60 )
if( secs < 10 )
secs = 0%secs%
if( outputMaxTime == "Hours" )
{
hour += Floor( mins / 60 )
mins := Mod( mins, 60 )
if( mins < 10 )
mins = 0%mins%
}
outputString := hour . ":" . mins . ":" secs
if( !RegExMatch( outputString, "^0:(\d+:\d+)", outputString ))
outputString1 := outputString
TCStatus := (aControl == "TMyListBox1") ? "TMyPanel8": "TMyPanel5"
ControlGetText, statusText, %TCStatus%, ahk_id %aApp%
;;
;; BUG: unable to change TC's StatusBar...
;;
;ControlSetText, %TCStatus%,FOOBAR , ahk_id %aApp% ;; "(%outputString1%) %statusText%", A
;MsgBox, (%outputString1%) %statusText%
ClipBoard = %statusText% --> TotalTime Selected: (%outputString1%)
PostMessage, 0x433, 4003 ;; Focus on Command-Line
Send, ^v ;; Paste Clipboard to Command-Line
return
A customizable Status-Bar would be pretty cool, Too bad.
Too difficult to do a time-counter? I think not, MVV.