by Nanya » Fri Oct 19, 2012 5:41 pm
Yeah, I tried this code: (
Tracks is a SDBSongList)
Code: Select all
SDB.MainTracksWindow.Refresh
Dim oShell
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys "^a"
SDB.UI.MainWindowFocus = 2
SDB.MainTracksWindow.RemoveSelectedTracks
For a = 0 to Tracks.Count - 1
SDB.MainTracksWindow.AddTrack(Tracks.Item(a))
SDB.MainTracksWindow.Selected(a) = true
Next
SDB.MainTracksWindow.FinishAdding
Problem is,
oShell.SendKeys "^a" tries to execute before the refresh is finished, so it gets nothing. Putting a timer or sleep doesn't work, it just postpones the refresh. The only way to get it to select everything is to have a messagebox to pop up and the user closes it. I'm not sure what I'm doing wrong.
Yeah, I tried this code: ([i]Tracks[/i] is a SDBSongList)
[code]
SDB.MainTracksWindow.Refresh
Dim oShell
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys "^a"
SDB.UI.MainWindowFocus = 2
SDB.MainTracksWindow.RemoveSelectedTracks
For a = 0 to Tracks.Count - 1
SDB.MainTracksWindow.AddTrack(Tracks.Item(a))
SDB.MainTracksWindow.Selected(a) = true
Next
SDB.MainTracksWindow.FinishAdding[/code]
Problem is, [i]oShell.SendKeys "^a"[/i] tries to execute before the refresh is finished, so it gets nothing. Putting a timer or sleep doesn't work, it just postpones the refresh. The only way to get it to select everything is to have a messagebox to pop up and the user closes it. I'm not sure what I'm doing wrong.