script to convert
Hi
Just made a script to convert a dvdprofiler xml file to the format that this plugin wants.
input: c:\Collection.Xml
Output: C:\Program Files\InterVocative Software\DVD Profiler\IMAGES\new.htm
save to a convert.vbs and run it
text
On Error Resume Next
Msgbox "Put your Collection.Xml in c:\"
Dim objTXTwrite, objTXTread, strLine, strHeader
Set objFILE = CreateObject("Scripting.Filesystemobject")
Set objHOST = CreateObject("WScript.Shell")
SET objTXTwrite = objFILE.OpenTextFile("C:\Program Files\InterVocative Software\DVD Profiler\IMAGES\new.htm",2,1)
SET objTXTread = objFILE.OpenTextFile("C:\Collection.xml",1,1)
objTXTwrite.writeline "<CATALOG>"
strLine = objTXTread.Readline
Do While strLine <> "</Collection>"
If InStr(1,strLine,">") = 0 Then
MsgBox "no good"
Else
strHeader = Trim(Left(strLine,InStr(1,strLine,">")))
'MsgBox strHeader
Select Case strHeader
Case "<DVD>"
objTXTwrite.writeline "<MOVIE>"
Case "</DVD>"
objTXTwrite.writeline "</MOVIE>"
Case "<CollectionNumber>"
objTXTwrite.writeline "<SLOT>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</CollectionNumber>")-Len("</CollectionNumber>")-2) & "</SLOT>"
Case "<Title>"
objTXTwrite.writeline "<OTITLE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Title>")-Len("</Title>")-2) & "</OTITLE>"
Case "<Genres>"
strLine = objTXTread.Readline
strHeader = Trim(Left(strLine,InStr(1,strLine,">")))
objTXTwrite.writeline "<GENRE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Genre>")-Len("</Genre>")-4) & "</GENRE>"
Case "<ProductionYear>"
objTXTwrite.writeline "<YEAR>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ProductionYear>")-Len("</ProductionYear>")-2) & "</YEAR>"
Case "<DIRECTOR>"
objTXTwrite.writeline "<DIRECTOR>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</DIRECTOR>")-Len("</DIRECTOR>")-2) & "</DIRECTOR>"
Case "<ACTOR>"
objTXTwrite.writeline "<CAST>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ACTOR>")-Len("</ACTOR>")-2) & "</CAST>"
Case "<Overview>"
objTXTwrite.writeline "<PLOT>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Overview>")-Len("</Overview>")-2) & "</PLOT>"
Case "<ID>"
objTXTwrite.writeline "<IMAGE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ID>")-Len("</ID>")-2) & "f.JPG</IMAGE>"
End Select
End If
If strLine <> "</Collection>" THEN strLine = objTXTread.Readline
Loop
objTXTwrite.writeline "</CATALOG>"
objTXTwrite.Close
objTXTread.close
Msgbox "Done. The file is created in C:\Program Files\InterVocative Software\DVD Profiler\IMAGES and is called new.htm"
PS: I would be great to have the source code to the pluginS
//Lasse
Hi
Just made a script to convert a dvdprofiler xml file to the format that this plugin wants.
input: c:\Collection.Xml
Output: C:\Program Files\InterVocative Software\DVD Profiler\IMAGES\new.htm
save to a convert.vbs and run it
text
On Error Resume Next
Msgbox "Put your Collection.Xml in c:\"
Dim objTXTwrite, objTXTread, strLine, strHeader
Set objFILE = CreateObject("Scripting.Filesystemobject")
Set objHOST = CreateObject("WScript.Shell")
SET objTXTwrite = objFILE.OpenTextFile("C:\Program Files\InterVocative Software\DVD Profiler\IMAGES\new.htm",2,1)
SET objTXTread = objFILE.OpenTextFile("C:\Collection.xml",1,1)
objTXTwrite.writeline "<CATALOG>"
strLine = objTXTread.Readline
Do While strLine <> "</Collection>"
If InStr(1,strLine,">") = 0 Then
MsgBox "no good"
Else
strHeader = Trim(Left(strLine,InStr(1,strLine,">")))
'MsgBox strHeader
Select Case strHeader
Case "<DVD>"
objTXTwrite.writeline "<MOVIE>"
Case "</DVD>"
objTXTwrite.writeline "</MOVIE>"
Case "<CollectionNumber>"
objTXTwrite.writeline "<SLOT>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</CollectionNumber>")-Len("</CollectionNumber>")-2) & "</SLOT>"
Case "<Title>"
objTXTwrite.writeline "<OTITLE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Title>")-Len("</Title>")-2) & "</OTITLE>"
Case "<Genres>"
strLine = objTXTread.Readline
strHeader = Trim(Left(strLine,InStr(1,strLine,">")))
objTXTwrite.writeline "<GENRE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Genre>")-Len("</Genre>")-4) & "</GENRE>"
Case "<ProductionYear>"
objTXTwrite.writeline "<YEAR>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ProductionYear>")-Len("</ProductionYear>")-2) & "</YEAR>"
Case "<DIRECTOR>"
objTXTwrite.writeline "<DIRECTOR>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</DIRECTOR>")-Len("</DIRECTOR>")-2) & "</DIRECTOR>"
Case "<ACTOR>"
objTXTwrite.writeline "<CAST>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ACTOR>")-Len("</ACTOR>")-2) & "</CAST>"
Case "<Overview>"
objTXTwrite.writeline "<PLOT>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</Overview>")-Len("</Overview>")-2) & "</PLOT>"
Case "<ID>"
objTXTwrite.writeline "<IMAGE>" & Mid(strLine,InStr(1,strLine,">")+1,InStr(1,strLine,"</ID>")-Len("</ID>")-2) & "f.JPG</IMAGE>"
End Select
End If
If strLine <> "</Collection>" THEN strLine = objTXTread.Readline
Loop
objTXTwrite.writeline "</CATALOG>"
objTXTwrite.Close
objTXTread.close
Msgbox "Done. The file is created in C:\Program Files\InterVocative Software\DVD Profiler\IMAGES and is called new.htm"
PS: I would be great to have the source code to the pluginS
//Lasse