; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: Kevin B. Carpenter ; ; Script Function: ; Reads a m3u file and copys or moves the files to the directory you tell it to. Useful ; for copying your favorite playlist or similar files to a remote device, memory card, or ; directory for later burning. ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. $plFile := "" $fileLog := "" $outDir := "" $totFiles := 0 Gosub ShowMainForm Return ;=============================================================================== ; Gui Subs ;=============================================================================== ShowMainForm: Gui, Font, S10 CDefault, Verdana Gui, Add, Text, x6 y7 w60 h20 , Playlist: Gui, Add, Edit, x76 y7 w320 h20 v$plFile, Select Playlist Gui, Add, Button, x406 y7 w60 h20 gOpenPlaylistFile, Open Gui, Add, Text, x6 y37 w60 h20 , Output: Gui, Add, Edit, x76 y37 w320 h20 v$outDir, Select Output Directory Gui, Add, Button, x406 y37 w60 h20 gOpenOutDir, Open Gui, Add, Progress, x6 y67 w460 h20 vProgBar -Smooth, 0 Gui, Add, Edit, x6 y97 w460 h70 v$fileLog ReadOnly -Wrap, Gui, Add, Button, x26 y177 w100 h30 gCopyFiles, Copy Gui, Add, Button, x186 y177 w100 h30 gMoveFiles, Move Gui, Add, Button, x346 y177 w100 h30 gGuiClose, Quit Gui, Show, x131 y91 h221 w479, Playlist File Copying/Moving Return OpenPlaylistFile: FileSelectFile $plFile, 1, , Select Playlist, *.m3u Gosub CountFiles GuiControl,, $plFile, %$plFile% return OpenOutDir: FileSelectFolder, $outDir, 1, Select Output Directory GuiControl,, $outDir, %$outDir% return CountFiles: Loop, read, %$plFile% { IfInString, A_LoopReadLine, #EXT continue Else $totFiles := $totFiles + 1 } GuiControl,, ProgBar, Range1-%$totFiles% return CopyFiles: Loop, read, %$plFile% { IfInString, A_LoopReadLine, #EXT continue Else $fileLog := "Copying " . A_LoopReadLine . "`n" . $fileLog GuiControl,, $fileLog, %$fileLog% FileCopy, %A_LoopReadLine%, %$outDir% GuiControl,, ProgBar, +1 } MsgBox, We are done copying files! Thank you! return MoveFiles: Loop, read, %$plFile% { IfInString, A_LoopReadLine, #EXT continue Else $fileLog := "Copying " . A_LoopReadLine . "`n" . $fileLog GuiControl,, $fileLog, %$fileLog% FileMove, %A_LoopReadLine%, %$outDir% GuiControl,, ProgBar, +1 } MsgBox, We are done copying files! Thank you! return GuiClose: ExitApp