'-------------------------------------------------------------------- ' CropPic.vbs ' Crop the selected picture to the specified rectangle. '-------------------------------------------------------------------- Option Explicit app.ClearTrace dim alb, i, n, nbPic, pic, filename, bOK, k set alb = app.GetCurrentAlbum nbPic = alb.NbSelectedPicture app.trace nbPic & " pictures to crop" dim l,t,r,b l = 15 t = 3 r = 713 b = 478 n = alb.NbPicture const TYPE_JPEG=2 for i = 0 to n-1 Set pic = alb.GetPicture(i) if pic.bSelected then ' Get the relative path of the picture filename = alb.ExpandMacro( pic, "%RP" ) app.Trace " Processing #" & i+1 & " " & filename bOK = pic.copyRect( l, t, r, b, -1 ) k = len(filename) filename = left(filename,k-4) & "C.jpg" alb.Paste filename 'pic.UpdateThumbnail True 'exit for end if next alb.ReDraw app.trace "Done!!!"