0
votes

I've a text file separated with commas, in that file the first value is the duration in milliseconds of several videos I want to reproduce (second token would be the name and extension of the file), what I want to do is tell my VBScript is to open and wait that number of milliseconds (so the video can finish) and then to close the process (VLC.exe) so it can reopen in a loop until the sequence of the text file finishes.

So far I've archived this; will return the first token (duration) of the video, but I cant set it into a "WScript.Sleep", would appreciate some help to finish this puzzle

Const ForReading = 1 

Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objTextFile = objFSO.OpenTextFile _ 
    ("C:\VIDEOSTATS.txt", ForReading) 

Do Until objTextFile.AtEndOfStream 
    strNextLine = objTextFile.Readline 
    arrServiceList = Split(strNextLine , ",") 
    Wscript.Echo "Duracion: " & arrServiceList(0) 

Loop 
1

1 Answers

2
votes
WScript.Sleep CLng(arrServiceList(0))

You need a numeric value to call Sleep