karist wrote: 2024-01-11, 10:11 UTC
The status line does not only contain static information, but also the total length of the containing folder and the number of folders and files:
"0 k/673368 k - 0 / 9 files, 0/ 520 dir"
Does this obvious fact change anything? You can select files of different formats. Based on what logic should priority be given to calculating the time of media files?
karist wrote: 2024-01-11, 10:11 UTC
So we're still talking about the same thing and the real Total Commander developer is not responding to anything, not developing my sensible and easy to implement request into the program.
Sometimes he reacts to something. Sometimes he even implements something that he did not react to at all. We can only wait.
karist wrote: 2024-01-11, 10:11 UTC
All I read is bafflement and bickering in this forum. I did not think it was such a big deal. What is there not to understand!?
I don't know why you didn't understand. What's the bickering got to do with it? In my last post, it was about identifying with what I have implemented. This message had nothing to do with supporting the request.
karist wrote: 2024-01-11, 10:11 UTC
I read the first comments with optimism, but I was no closer to a solution with such a simple request. sorry
We have topics with much simpler queries hanging here for years, and your request is only a month old! What are you talking about?
'ββββββββββββββββββββββββββββββ VBS βββββββββββββββββββββββββββββ
' Purpose: Calculating the total duration of selected media files
' Parameters: %WL <filter extensions via |> [/c]
' /c β copy the result to the clipboard instead of displaying
' Example: %WL 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob /c
'ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Option Explicit: Dim A, oDesk, oFSO, oList, F, Dur
Const Title = " Total duration of selected media files"
Set A = WSH.Arguments: If A.Count = 0 Then WSH.Quit
Set oDesk = CreateObject("Shell.Application").NameSpace(0)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oList = oFSO.OpenTextFile(A(0),,,-1)
Do: F = oList.ReadLine
If Right(F, 1) <> "\" Then _
If InStr(1, "|" & A(1) & "|", "|" & oFSO.GetExtensionName(F) & "|", 1) Then _
Dur = Dur + CDbl(oDesk.ParseName(F).ExtendedProperty("Duration"))
Loop Until oList.AtEndOfStream: oList.Close
Set oList = Nothing: Set oDesk = Nothing: Set oFSO = Nothing
If IsEmpty(Dur) Then
MsgBox "There are no suitable media files!", 262192, Title
Else
Dur = TimeSerial(0, 0, FormatNumber(CDbl(Dur/10000000), 0))
If A.Named.Exists("c") Then
With CreateObject("WScript.Shell")
If .Run("%ComSpec% /q/c <nul set /p=""" & Dur & """|clip", 0, 1) Then _
.Run "mshta ""javascript:close(clipboardData.setData('text','" & Dur & "'))""", 7
End With
Else MsgBox Space(14) & Dur, 262208, Title End If
End If
Drag the file to the toolbar, specify the parameters in the second button field.
2Native2904
The fixed version was posted here under a spoiler.
P.S. Now, instead, I use the command created in Autorun, where clipboard saving and tooltip display under the file cursor are implemented.
Unfortunately, the new text is not rendered in the status bar, although it is linked to the handle at the API level.