' --------------------------------------------
'         Test for renaming a picture
' --------------------------------------------
Option Explicit
app.ClearTrace

dim alb, nbPic, fso, pic, filename, newFile, a, new2File
set alb = app.GetCurrentAlbum
Set fso = CreateObject("Scripting.FileSystemObject")

set pic = alb.GetVisiblePicture( alb.nCurrentPicture )
filename = alb.ExpandMacro( pic, "%RP" )

app.Trace "Picture = " & filename
Set a = fso.GetFile( filename )
' Make backup of the picture
newFile = filename & ".bak"
app.Trace "  Copied to = " & newFile
a.Copy newFile

new2File = left(filename , instrrev(filename,"\")) & "Canon Valley Trail 10-14-2000"
Set a = fso.GetFile( newFile )
app.Trace "  Renamed to = " & new2File
a.Move new2File
app.trace "Done!!!"

