' ------------------------------------------------------------------------------------ ' SaveFPXRSound ' This script will analyze the selected pictures. If an embedded sound (FPXR ' extension in JPEG file) is found the sound is save in a file have the same name ' as the picture. ' ------------------------------------------------------------------------------------ Option Explicit app.ClearTrace dim alb, i, n, nbPic, fso set alb = app.GetCurrentAlbum nbPic = alb.NbSelectedPicture app.trace nbPic & " pictures to process" n = alb.NbPicture dim pic, filename, k for i = 0 to n-1 Set pic = alb.GetPicture(i) if pic.bSelected then pic.load True if pic.getPicDataType(0) = 1 then ' Type 1 is FPXR sound ' Get the relative path of the picture filename = alb.ExpandMacro( pic, "%RP" ) app.Trace " Processing #" & i+1 & " " & filename app.Trace " Found wav data: " & pic.getPicDataSize(0) & " bytes" k = instrrev( filename, "." ) filename = left( filename, k-1 ) & "_.wav" app.Trace " Saving wav data in '" & filename & "'..." pic.SavePicData 0, filename end if pic.load False end if next alb.ReDraw app.trace "Done!!!"