'------------------------------------------------------------------------- ' GetMavicaPictures.vbs ' This script will scan a source folder (a floppy for instance) and move ' the found pictures (*.jpg files) to the hard disk. ' The pictures will be renamed using the date of the file : ' [mm_dd_yy][hh_mn_ss].jpg ' Change the value of the "sTargetFolder" constant to the full path of ' the target folder (this folder must exist). '------------------------------------------------------------------------- option explicit const sMavicaFolder = "a:\" 'const sMavicaFolder = "m:\mavica" const sTargetFolder = "m:\mavica2" Dim oShell, item, fso, nbPic, alb app.cleartrace Set oShell = CreateObject("Shell.Application") Set fso = CreateObject("Scripting.FileSystemObject") Set alb = App.GetCurrentAlbum app.trace "Processing pictures from " & sMavicaFolder & "..." nbPic = 0 browseFolder sMavicaFolder, 0 app.trace "Done !" & vbTab & nbPic & " pictures processed" Function browseFolder( sFolderName, nLevel ) dim f, item, i, datepic, sNewFile, s set f = oShell.NameSpace( sFolderName ) 'f.parsename "*.jpg" for each item in f.items if item.isfolder then browseFolder item.path, nLevel+1 else if lcase(right(item.name,4)) = ".jpg" then datepic = item.ModifyDate ' Build the name of the target file sNewFile = sTargetFolder & "\[" s = DatePart( "d", datepic) if cint(s) < 10 then s = "0" & s sNewFile = sNewFile & s & "_" s = DatePart( "m", datepic) if cint(s) < 10 then s = "0" & s sNewFile = sNewFile & s & "_" s = DatePart( "yyyy", datepic) sNewFile = sNewFile & right(s,2) & "][" s = DatePart( "h", datepic) if cint(s) < 10 then s = "0" & s sNewFile = sNewFile & s & "_" s = DatePart( "n", datepic) if s < "10" then s = "0" & s sNewFile = sNewFile & s & "_" s = DatePart( "s", datepic) if s < "10" then s = "0" & s sNewFile = sNewFile & s & "].jpg" app.trace item.name & vbTab & datepic & vbTab & "-->" & vbTab & sNewFile ' Copy the picture and add it to the current album CopyFile item.Path, sNewFile alb.AddPicture sNewFile alb.Redraw nbPic = nbPic + 1 end if end if next End Function Function CopyFile( sSourceFile, sDestFile ) Dim a Set a = fso.GetFile( sSourceFile ) a.Copy sDestFile ' Uncomment the following line to __REALLY__ delete the pictures from the source folder 'a.Delete End Function