View Single Post
Old 31st August 2004, 11:35   #16
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
More examples and a suggestion

More examples
code:

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const LogFile = "c:\songlog.txt"
Set fso = CreateObject("Scripting.FileSystemObject")

Sub WAObj_ChangedTrack
Dim s, text
s = playlist(playlist.position).ATFString("%artist% - %album% '('%filename%')'")

If Not fso.FileExists(LogFile) Then
Set text = fso.CreateTextFile(LogFile)
Else
Set text = fso.OpenTextFile(LogFile, ForAppending)
End If
text.WriteLine s
text.Close
End Sub



Suggestion

Why not putting error messages in the lower edit box, instead of calling MessageBox() all the time. Very nasty if script contains a lot of errors (not that I have a lot of errors in my scripts).
saivert is offline   Reply With Quote