Your Digital Media Has Never Looked So Good

Topic Author
Posts: 2
Joined: Sun Feb 17, 2008 9:37 am
Location: Chicago area

SearchSongs by filename?

Sun Feb 17, 2008 9:47 am

I'm working on a script where I can play a song from Windows Explorer by clicking on the name and play it on the soundbridge.

I wrote a vbscript where I pass the filename to it.
I'm using the SearchSongs command.
Sometimes it finds the song, sometimes it doesn't. I'm not sure why.
I've noticed the Search functions do not include a filename, but rather search on the ID tag fields. Is that my problem? Is there a way to search for the filename?

Maybe I'll convert from script to executable and search on Title, but I have a lot of songs missing Titles.
Topic Author
Posts: 2
Joined: Sun Feb 17, 2008 9:37 am
Location: Chicago area

Fri Mar 14, 2008 3:55 pm

I have a script to queue a song. if you change the comments, play a song.
I put a shortcut to the script in my SENDTO folder.
Now I can right mouse click on a song in the lib and 'sendto' my roku :D

'uses w3sockets from
'uses CDDBControl.dll (dont forget to register with regsvr32)
Set id3 = CreateObject("CDDBControlAOL.CddbID3Tag")
Set w3sock = CreateObject("socket.tcp")

'Get song name from command line
strFilePlay = wscript.Arguments.Item(0)
id3.LoadFromFile strFilePlay, False
'Make sure it has a title - some of mine didnt
If id3.Title = "" Then
id3.Title = Left(strFilePlay,Len(strFilePlay)-4)
id3.Title = Right(id3.Title,Len(id3.Title)-3)
End If
strFilePlay = id3.Title

'Connect to Roku
With w3sock
.DoTelnetEmulation = True
.TelnetEmulation = "TTY"
.WaitFor "roku: ready"
'Search for song
.SendLine "SearchSongs " & strFilePlay
strStatus = .GetLine 'Should be SearchSongs: TransactionInitiated
strStatus = .GetLine 'Should be SearchSongs: ListResultSize 1
num = right(strStatus,len(strStatus)-28) 'num contains number found
For x=0 To num-1
strStatus = .GetLine 'Should be SearchSongs *name of song*
If num<>1 Then
strStatus=Right(strStatus,Len(strStatus)-13) 'strip off SearchSongs
strStatus=MsgBox("Play " & strStatus & "?",vbYesNo)
If strStatus = 6 Then '6=YES,7=NO
'.SendLine "QueueAndPlayOne " & x
.SendLine "NowPlayingInsert " & x
.SendLine "Play"
End If
'.SendLine "QueueAndPlayOne 0"
.SendLine "NowPlayingInsert 0"
.SendLine "Play"
End If

End With
Set w3sock = Nothing
Set id3 = Nothing

Who is online

Users browsing this forum: No registered users and 2 guests