New summarized value (eg. mp3 duration sum) write in the bottom of the fle list for [WDX] after the sum dir/file length

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Fla$her
Power Member
Power Member
Posts: 3006
Joined: 2020-01-18, 04:03 UTC

Re: New summarized value (eg. mp3 duration sum) write in the bottom of the fle list for [WDX] after the sum dir/file le

Post by *Fla$her »

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
:shock: We have topics with much simpler queries hanging here for years, and your request is only a month old! What are you talking about?
Overquoting is evil! πŸ‘Ž
User avatar
Native2904
Member
Member
Posts: 177
Joined: 2014-01-30, 14:23 UTC
Location: Aachen

Re: New summarized value (eg. mp3 duration sum) write in the bottom of the fle list for [WDX] after the sum dir/file le

Post by *Native2904 »

Fla$her wrote: 2023-12-11, 23:45 UTC 2karist
Try this .vbs:

Code: Select all

'β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” 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.
I get this message:

Code: Select all

Skript:	C:\tcmd\Scripte\CalculatingTheTotalDurationOfSelectedMediaFiles\CalculatingTheTotalDurationOfSelectedMediaFiles.vbs
Zeile:	23
Zeichen:	4
Fehler:	Überlauf: '[string: 1.064.273]'
Code:	800A0006
Quelle: 	Laufzeitfehler in Microsoft VBScript
Trying to list the complete Playtime of Series.
GlΓΌckauf
#270101 Single user licence.

Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz | 16,00 GB | Windows 10 Pro 22H2
Fla$her
Power Member
Power Member
Posts: 3006
Joined: 2020-01-18, 04:03 UTC

Re: New summarized value (eg. mp3 duration sum) write in the bottom of the fle list for [WDX] after the sum dir/file le

Post by *Fla$her »

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.
Overquoting is evil! πŸ‘Ž
User avatar
Native2904
Member
Member
Posts: 177
Joined: 2014-01-30, 14:23 UTC
Location: Aachen

Re: New summarized value (eg. mp3 duration sum) write in the bottom of the fle list for [WDX] after the sum dir/file le

Post by *Native2904 »

2*Fla$her
Thank you. Run without any problem.
GlΓΌckauf
#270101 Single user licence.

Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz | 16,00 GB | Windows 10 Pro 22H2
Post Reply