'---------------------------------------------------------------------------- ' HTML-Slideshow.vbs ' This is a simple HTML generator written in VBScript ' ' It generates a slideshow from the current album. ' Input fields are time delay in seconds ' and picture size in Pix. (900 is fine for 1024x768) '---------------------------------------------------------------------------- Option Explicit app.ClearTrace dim timedil, newsize timedil = InputBox( "Please enter the time delay in seconds ", "Slide show generator", "5") newsize = InputBox( "Please enter the picture size in pix ", "Slide show generator", "900") Dim alb, pic, nbPic, i, outputFileName, picFile const typ = 2 set alb = app.GetCurrentAlbum nbPic = alb.nbPicture Const ForReading = 1, ForWriting = 2 for i=0 to nbPic-1 Set pic = alb.GetPicture(i) app.trace pic.sFileName & (i) & nbPic-1 & nbPic outputFileName = "picture" & (i) & ".htm" app.Trace "Output file = " & outputFileName Dim fso, f, m Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile( outputFileName, ForWriting, True) f.WriteLine "" f.WriteLine "" if (i+1) = nbPic then f.WriteLine " " else f.WriteLine " " end if f.WriteLine "" f.WriteLine "" picFile = alb.ExpandMacro( pic, "%RP" ) picFile = app.HTMLFileName(picFile, "") f.WriteLine "" f.WriteLine "
" & Replace( pic.sComment, chr(13)&chr(10), "
" ) f.WriteLine "" f.WriteLine "" f.Close next app.Run "picture0.htm", True, -1 app.Trace "HTML file generation complete !"