by kireev20000 » Sun Mar 06, 2016 8:46 am
replace code in OutputTextFile.vbs
Version for OBS txt plug-in (no unicode support)
Code: Select all
' OutputTextFile.vbs
' Write the current playing track and artist to a text file
option explicit
sub OutputTextFile
dim objFSO, objTextFile, strTextFilePath, strTrack, strArtist, strAlbum
'SET THIS TO LOCATION OF FILE
strTextFilePath = "e:\Soft\_MediaMonkey\obs_song.txt"
'Get the artist/track
strTrack = SDB.Player.CurrentSong.Title
strArtist = SDB.Player.CurrentSong.Artist.Name
strAlbum = SDB.Player.CurrentSong.AlbumName
'Open the file & write
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objfso.FileExists(strTextFilePath)) Then
Set objTextFile = objFSO.OpenTextFile(strTextFilePath,2)
Else
Set objTextFile = objFSO.CreateTextFile(strTextFilePath,2)
End If
On Error Resume Next
If strArtist = "" Then
objTextFile.WriteLine "Music: " & strTrack & " /" & strAlbum & "/"
Else
objTextFile.WriteLine "Music: " & strArtist & " - " & strTrack & " /" & strAlbum & "/"
End If
If Err.Number <> 0 Then
objTextFile.WriteLine "Error: Unicode Text"
Err.Clear
End If
'close the file
objTextFile.Close
end sub
With Unicode Support
Code: Select all
' OutputTextFile.vbs
' Write the current playing track and artist to a text file
option explicit
sub OutputTextFile
dim objFSO, objTextFile, strTextFilePath, strTrack, strArtist, strAlbum
'SET THIS TO LOCATION OF FILE
strTextFilePath = "e:\Soft\_MediaMonkey\obs_song.txt"
'Get the artist/track
strTrack = SDB.Player.CurrentSong.Title
strArtist = SDB.Player.CurrentSong.Artist.Name
strAlbum = SDB.Player.CurrentSong.AlbumName
'Open the file & write
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(strTextFilePath,2,-2)
On Error Resume Next
If strArtist = "" Then
objTextFile.WriteLine "Music: " & strTrack & " /" & strAlbum & "/"
Else
objTextFile.WriteLine "Music: " & strArtist & " - " & strTrack & " /" & strAlbum & "/"
End If
If Err.Number <> 0 Then
objTextFile.WriteLine "Error"
Err.Clear
End If
'close the file
objTextFile.Close
end sub
replace code in OutputTextFile.vbs
Version for OBS txt plug-in (no unicode support)
[code]
' OutputTextFile.vbs
' Write the current playing track and artist to a text file
option explicit
sub OutputTextFile
dim objFSO, objTextFile, strTextFilePath, strTrack, strArtist, strAlbum
'SET THIS TO LOCATION OF FILE
strTextFilePath = "e:\Soft\_MediaMonkey\obs_song.txt"
'Get the artist/track
strTrack = SDB.Player.CurrentSong.Title
strArtist = SDB.Player.CurrentSong.Artist.Name
strAlbum = SDB.Player.CurrentSong.AlbumName
'Open the file & write
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objfso.FileExists(strTextFilePath)) Then
Set objTextFile = objFSO.OpenTextFile(strTextFilePath,2)
Else
Set objTextFile = objFSO.CreateTextFile(strTextFilePath,2)
End If
On Error Resume Next
If strArtist = "" Then
objTextFile.WriteLine "Music: " & strTrack & " /" & strAlbum & "/"
Else
objTextFile.WriteLine "Music: " & strArtist & " - " & strTrack & " /" & strAlbum & "/"
End If
If Err.Number <> 0 Then
objTextFile.WriteLine "Error: Unicode Text"
Err.Clear
End If
'close the file
objTextFile.Close
end sub
[/code]
With Unicode Support
[code]
' OutputTextFile.vbs
' Write the current playing track and artist to a text file
option explicit
sub OutputTextFile
dim objFSO, objTextFile, strTextFilePath, strTrack, strArtist, strAlbum
'SET THIS TO LOCATION OF FILE
strTextFilePath = "e:\Soft\_MediaMonkey\obs_song.txt"
'Get the artist/track
strTrack = SDB.Player.CurrentSong.Title
strArtist = SDB.Player.CurrentSong.Artist.Name
strAlbum = SDB.Player.CurrentSong.AlbumName
'Open the file & write
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(strTextFilePath,2,-2)
On Error Resume Next
If strArtist = "" Then
objTextFile.WriteLine "Music: " & strTrack & " /" & strAlbum & "/"
Else
objTextFile.WriteLine "Music: " & strArtist & " - " & strTrack & " /" & strAlbum & "/"
End If
If Err.Number <> 0 Then
objTextFile.WriteLine "Error"
Err.Clear
End If
'close the file
objTextFile.Close
end sub
[/code]