Well Trix, you post troubled me....
So i digged a bit.
I tried the following code
Code: Select all
Sub CueReader
cuef = SDB.ApplicationPath&"Scripts\CueReader2.vbs"
If SDB.Tools.FileSystem.FileExists(cuef) Then
Set WShell = CreateObject("WScript.Shell")
line = "wscript "&Chr(34)&cuef&Chr(34)
res = WShell.Run(line, 1, 1)
End If
MsgBox "Cue Reader just finished"
End Sub
And
Code: Select all
Set SDB = CreateObject("SongsDB.SDBApplication")
Do while SDB.Player.isPlaying
WScript.Sleep 200
Loop
MsgBox "Monitor just finished"
Guess what, monitor was exiting before the cuereader, since the first script was paused while the second was running. After the monitor exits the first script reevaluates the if statement, causing the the second script to run again and also causing the MM player to restart.
Now, i dont know why this happens only if the current songlist has changed. Perhaps its a bug...
The point is that i found a workaround
if you execute the second script like this
Then, the first script dont wait for the second and terminates. This eliminates this bug
Hope this helps
Well Trix, you post troubled me....
So i digged a bit.
I tried the following code
[code]Sub CueReader
cuef = SDB.ApplicationPath&"Scripts\CueReader2.vbs"
If SDB.Tools.FileSystem.FileExists(cuef) Then
Set WShell = CreateObject("WScript.Shell")
line = "wscript "&Chr(34)&cuef&Chr(34)
res = WShell.Run(line, 1, 1)
End If
MsgBox "Cue Reader just finished"
End Sub[/code]
And
[code]Set SDB = CreateObject("SongsDB.SDBApplication")
Do while SDB.Player.isPlaying
WScript.Sleep 200
Loop
MsgBox "Monitor just finished"
[/code]
Guess what, monitor was exiting before the cuereader, since the first script was paused while the second was running. After the monitor exits the first script reevaluates the if statement, causing the the second script to run again and also causing the MM player to restart.
Now, i dont know why this happens only if the current songlist has changed. Perhaps its a bug...
The point is that i found a workaround
if you execute the second script like this
[code] res = WShell.Run(line, 1, 0)[/code]
Then, the first script dont wait for the second and terminates. This eliminates this bug
Hope this helps