Function TrimName(FileName)
If Len(FileName) > 15 Then TrimName = Left(FileName,15) & "..." : Else TrimName = FileName
End Function
Function ViewTorrents()
Dim fso, file, ts
Set fso = CreateObject("Scripting.FileSystemObject"

Set file = fso.GetFile("C:\Program Files\BitComet\Downloads.xml"

Set ts = file.OpenAsTextStream()
ViewTorrents = ""
While not ts.AtEndOfStream
line = ts.ReadLine()
if InStr(line,"<Torrent "

Then
Dim regex, res, tinfo
Set regex = New RegExp
regex.Global = True
regex.IgnoreCase = True
regex.Pattern = "[a-z]+=""[a-z0-9_\\:\+\[\]() .-]+"""
Set res = regex.Execute(line)
Set tinfo = CreateObject("Scripting.Dictionary"

For Each r In res
s = Split( r, "=" )
tinfo.Add s(0), Mid( s(1), 2, Len( s(1) ) - 2 )
Next
GetByte = (int(tinfo("SelectedSize"

) / 1024/1024) - (int(tinfo( "Left" )) /1024/1024)
TotalByte = (int(tinfo("SelectedSize"

) / 1024/1024)
If GetByte <> TotalByte Then
'Not Completed Download
ViewTorrents = ViewTorrents & "ļ " & TrimName(tinfo( "ShowName" )) & " DL: " & formatnumber(GetByte,2) & " of " & formatnumber(TotalByte,2) & " MB." & vbCRLF
Else
'Completed Download
ViewTorrents = ViewTorrents & "š " & TrimName(tinfo( "ShowName" )) & " DL: " & formatnumber(GetByte,2) & " of " & formatnumber(TotalByte,2) & " MB." & vbCRLF
End If
End If
WEnd
End Function
little update by me