'------------------------------------------------------------------------- ' FindOrphans : select the thumbnails that don't link to a picture '------------------------------------------------------------------------- Option Explicit app.cleartrace Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Const ForReading = 1, ForWriting = 2 ' Define the variables dim alb, nb, nbO, i, pic, albFile set alb = app.GetCurrentAlbum nb = alb.nbPicture nbO = 0 app.Trace "Pictures in this album: " & nb alb.nbSelectedPicture = 0 for i=0 to nb-1 Set pic = alb.GetPicture(i) albFile = alb.ExpandMacro( pic, "%RP" ) app.trace albFile on error resume next Set f = fso.OpenTextFile( albFile, ForReading, False ) if Err.Number<>0 then app.trace " " & albFile pic.bSelected = True nbO = nbO + 1 err.clear end if f.close next alb.ReDraw app.StatusBarText = nbO & " pictures not found" app.trace "Done !"