The first script is a ScriptType=2 so runs when a track plays. All it does is look for and run a second script file.
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
End Sub
Code: Select all
Set SDB = CreateObject("SongsDB.SDBApplication")
Do while SDB.Player.isPlaying
WScript.Sleep 200
Loop
1) Play a file so the first script starts (which starts the second script and ends).
2) Click on some node/playlist so another track appears in the library window.
3) Press stop on the player (which ends the second script).
The song that is first in the library window will now start playing. It doesn't always happen. But about 80% of the time it does. Any ideas?