' ------------------------------------------------------------------------------------ ' Rename_JPG_to_jpg.vbs ' This script will rename the JPEG pictures that have an uppercase suffix to a ' lowercase one. ' The file is renamed on the disk and in the album. ' ------------------------------------------------------------------------------------ Option Explicit app.ClearTrace Dim alb, pic, fso, nbPic, i, picFile, k, a, newPicFile set alb = app.GetCurrentAlbum Set fso = CreateObject("Scripting.FileSystemObject") ' Process each picture nbPic = alb.nbPicture app.Trace "Pictures in this album: " & nbPic for i=0 to nbPic-1 Set pic = alb.GetPicture(i) picFile = alb.ExpandMacro( pic, "%RP" ) k = InStrRev( picFile, "." ) if mid( picFile, k ) = ".JPG" then Set a = fso.GetFile( picFile ) newPicFile = left( picFile, k ) & "jpg" app.Trace picFile & " ---> " & newPicFile ' Sometime a two-pass process is needed, if so, uncomment the following line 'a.Move newPicFile & "_Z" a.Move newPicFile ' Rename in the album to picFile = pic.sFileName k = InStrRev( picFile, "." ) newPicFile = left( picFile, k ) & "jpg" pic.sFileName = newPicFile end if next alb.redraw app.Trace "Done!!!"