by Peke » Mon Jan 18, 2021 4:03 am
Hi,
Hmmm, that still do not explain why you need focus on Current track when you can just ignore it and use additional script with command to delete track if you do not like it and select next track or use your existing Script to Like track and go to next.
Other approach would be to register On play Event and focus on current playing track. eg. something like this.
Code: Select all
Script.RegisterEvent SDB, "OnPlay", "SDB_OnTrackPlay"
Dim InEventHandler : InEventHandler = False ' Control variable (shows if event handler is executing)
Sub SDB_OnTrackPlay(TrackList)
If InEventHandler Then Exit Sub ' Prevent executing event handler from within itself
InEventHandler = True ' Event starts --> set control variable
Dim a
Set a = CreateObject("WScript.Shell")
a.SendKeys "{F8}"
End Sub
Hi,
Hmmm, that still do not explain why you need focus on Current track when you can just ignore it and use additional script with command to delete track if you do not like it and select next track or use your existing Script to Like track and go to next.
Other approach would be to register On play Event and focus on current playing track. eg. something like this.
[code]Script.RegisterEvent SDB, "OnPlay", "SDB_OnTrackPlay"
Dim InEventHandler : InEventHandler = False ' Control variable (shows if event handler is executing)
Sub SDB_OnTrackPlay(TrackList)
If InEventHandler Then Exit Sub ' Prevent executing event handler from within itself
InEventHandler = True ' Event starts --> set control variable
Dim a
Set a = CreateObject("WScript.Shell")
a.SendKeys "{F8}"
End Sub[/code]