' ------------------------------------------------------------------------------------ ' JavascriptHTMLSlideshow.vbs ' This script will generate an HTML slideshow with some javascript code to do the ' animation. ' The generated code uses standard DHTML code and will run under Netscape 6, IE ' and Konqueror. ' The HTML file will be written in the folder where the album file is present. ' Note: Pictures are loaded in memory as they are displayed so big slideshows will ' consume all available memory. Pictures are then freed and only the last ' nbMaxPictureToKeep pictures are kept. ' ------------------------------------------------------------------------------------ Option Explicit app.ClearTrace const titleText = "%AN" ' Display String for page title 'const pictureText = "%FN (%FK KB)" ' Display String for the picture comment 'const pictureText = "%C7 - %1C%|%C1 %C2" const pictureText = "%C8 - %1C - %C1 %LE[%C2,5]" const selectText = "%p# - %C8 - %1C - %C1 %LE[%C2,5]" ' Set it to an empty string to remove the selection drop-down list 'const selectText = "%p# - %C7 - %1C - %C1 %C2" ' Set it to an empty string to remove the selection drop-down list const nbMaxPictureToKeep = 5 const bShowPicNumber = TRUE ' Display the current picture number with the comment const nFastForwardStep = 5 ' How many picture to skip with the >> and << buttons Dim alb, pic, fso, f, sAlbumPath, k set alb = app.GetCurrentAlbum sAlbumPath = alb.ExpandMacro( Nothing, "%Af" ) Dim outputFileName, sTitle outputFileName = "Slideshow.html" 'InputBox( "Please enter the name of the HTML file to create", "JavascriptHTMLSlideshow generator", "JavascriptSlideshow.html") outputFileName = sAlbumPath & "\" & outputFileName app.Trace "Output file = " & outputFileName, -1, TRACE_INFORMATION Const ForReading = 1, ForWriting = 2 Dim nbPic, i, w, nbSelPic, sFirstPic, s, sCmt, duration, ixPic nbPic = alb.nbPicture nbSelPic = alb.nbSelectedPicture app.Trace "Pictures selected in this album: " & nbSelPic, -1, TRACE_INFORMATION Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile( outputFileName, ForWriting, True) f.WriteLine "" f.WriteLine "" f.WriteLine "" sTitle = alb.ExpandMacro( Nothing, titleText ) f.WriteLine " " & sTitle & "" f.WriteLine " " f.WriteLine " " f.WriteLine " " f.WriteLine "" f.WriteLine "" f.WriteLine "" f.WriteLine "" & vbcrlf f.WriteLine "" f.WriteLine "" & sTitle & "" & vbcrlf f.WriteLine "
" f.WriteLine "
" f.WriteLine "
" f.WriteLine " " f.WriteLine "
" f.WriteLine "

Please wait...

" f.WriteLine "
" & vbcrlf f.WriteLine "
" f.WriteLine "
" f.WriteLine "  " f.WriteLine "   " f.WriteLine "   " f.WriteLine "   " f.WriteLine "   " f.WriteLine "  " f.WriteLine "   " ' Generate a combo-box that allows to chose a picture directly if selectText <> "" then f.WriteLine " " end if f.WriteLine "
" f.WriteLine "
" & vbcrlf f.WriteLine "
Built with MyAlbum
" f.WriteLine "" & vbcrlf & "" f.Close app.Trace nbSelPic & " picture processed", -1, TRACE_INFORMATION app.Trace "HTML file generation complete !", -1, TRACE_OK ' Launch browser if nbSelPic > 0 then app.Run outputFileName, True, 0