|
' This example converts all SWF files in the folder into JPG image files ' Copy this script to the folder with SWF flash movies and run it ' Script will generate JPG image files using extracted frames from SWF Set SWFToImage = CreateObject("SWFToImage.SWFToImageObject") SWFToImage.InitLibrary "demo", "demo" Dim WshShell, fs, f, fc, f1, tsFile Set WshShell = WScript.CreateObject("WScript.Shell") sCurrentFolder = WshShell.CurrentDirectory Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(sCurrentFolder) ' current directory Set fc = f.Files Set fs = Nothing ' converting SWF files to JPEG image files For Each f1 in fc if UCase(Mid(f1.name, InstrRev(f1.name, ".") + 1)) = "SWF" then SWFToImage.InputSWFFileName = f1.name SWFToImage.FrameIndex = 0 ' number of frame to extract SWFToImage.ImageOutputType = 1 ' set output image type to Jpeg (0 = BMP, 1 = JPG, 2=GIF) SWFToImage.Execute SWFToImage.SaveToFile f1.name & ".jpg" End If Next
Set SWFToImage = nothing |