View Single Post
Old 31st August 2004, 11:14   #18
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Here is my final (for now) script:
code:

Const ForReading=1, ForWriting=2, ForAppending=8
Const LogFile="c:\songlog.txt"
Const FormatText="$if(%title%,[%artist% - ]%title%,$filepart(%filename%))"
Set fso=CreateObject("Scripting.FileSystemObject")
Set ieo=CreateObject("InternetExplorer.Application")
ieo.Navigate2("about:blank")
ieo.visible=True

Sub ShowPlaylist
Dim s, i
i=1
For Each file In playlist
s = s & "<br/>" & vbCrLf & i & ". " & file.ATFString(FormatText)
i = i + 1
Next

' The following line gives error. Why??
ieo.document.write("<pre>")

ieo.document.write(s)
ieo.document.write("<br/>" & vbCrLf)
ieo.document.write("<br/>" & vbCrLf)
ieo.document.write("Tracking played items:" & "<br/>" & vbCrLf)
End Sub

ShowPlaylist

Sub WAObj_ChangedTrack
Dim s, text
s = playlist(playlist.position).ATFString(FormatText)

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

ieo.document.write(s & "<br/>")
End Sub


1. Why can't I write ieo.document.write("<pre>")?
2. Do you have a limit on how much script code to write?
3. And why do you have to use () around parameters when it's not on the right side. Like:
code:

' Here it is neccessary with the "()"
Dim var
var = function("param", 23)

' Here it is *not* neccessary:
function "param", 23



4. Please put the Scripting dialog inside the preferences, or put it inside a embedWindow thing (skinned frame).
saivert is offline   Reply With Quote