' ------------------------------------------------------------------------------------ ' TestShuffleSlideshow.vbs ' Script written to check that in Shuffle slideshow mode, all the pictures are ' displayed. ' ------------------------------------------------------------------------------------ option explicit app.ClearTrace Const ForReading = 1, ForWriting = 2 Const sFile = "c:\TestShuffleSlideshow.txt" dim alb, i, iPic set alb = app.GetCurrentAlbum iPic = alb.nCurrentPicture app.Trace "Current picture: " & iPic Dim fso, fi, fo, s Set fso = CreateObject("Scripting.FileSystemObject") if fso.FileExists( sFile ) then fso.CopyFile sFile, sFile & ".old" else app.Trace "New file!!" Set fi = fso.CreateTextFile( sFile & ".old", True ) fi.Close set fi = Nothing end if 'on error resume next Set fi = fso.OpenTextFile( sFile & ".old", ForReading, False ) Set fo = fso.OpenTextFile( sFile, ForWriting, True ) i = 0 Do While fi.AtEndOfStream <> True s = fi.ReadLine if i = iPic then s = s & "X" 'app.Trace i & ":" & s fo.writeline s i = i + 1 Loop fi.Close set fi = Nothing while i <= iPic s = "" if i = iPic then s = "X" 'app.Trace i & ":" & s fo.writeline s i = i + 1 wend fo.Close set fo = Nothing