' ------------------------------------------------------------------------------------ ' LoadListFileToAlbum2.vbs ' Build an album from a text file listing the pictures to add. ' The text file contains the list of the picture to load in the current album, one ' per line. ' ------------------------------------------------------------------------------------ Option Explicit Const ForReading = 1 app.ClearTrace Dim alb, fso, f, s, k, bPic, pic, sFile Set fso = CreateObject("Scripting.FileSystemObject") set alb = app.GetCurrentAlbum app.Trace "Opening the list file..." sFile = app.GetFilename( "Select the text file to import", 0, "", "Text file (*.txt)|*.txt|All files (*.*)|*.*||", 0) if sFile <> "" then Set f = fso.OpenTextFile( sFile, ForReading ) bPic = False set pic = nothing Do While f.AtEndOfStream <> True s = f.ReadLine app.Trace s set pic = alb.AddPicture( s ) if pic is Nothing then app.Trace "Caution: picture """ & s & """ not found" Loop f.Close alb.Redraw end if app.Trace "Done !"