This script can be installed uncompiled by specifying the path to AutoHotkey.exe in the command line. Sample registry keys required to link it to the shell menu are posted below along with the source code.
Recognised audio formats:
WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA
Changelog:
* updated to write full path to audio files in m3u file
* updated to work with a wide range of audio formats
* updated to only create an m3u file if audio files exist in current directory
* script updated to get path details from clicked-on item
* script now titles the created .m3u file with the name of the directory it was created in
splitpath, 1, file, dir filegetattrib, attr, %1% if attr contains D ; launched from a directory { m3u = %dir%\%file%\%file%.m3u loop, %dir%\%file%\*.* { splitpath, A_LoopFileName, , , ext if ext in WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA { filelist = %filelist%%A_LoopFileLongPath%`n count++ } } if count = ; no audio files found return sort, filelist filedelete, %m3u% fileappend, #EXTM3U`n%filelist%, %m3u% } else ; launched from a file { ; get the current folder for the m3u name: stringsplit, array, dir, \ folder := array%array0% m3u = %dir%\%folder%.m3u loop, %dir%\*.* { splitpath, A_LoopFileName, , , ext if ext in WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA { filelist = %filelist%%A_LoopFileLongPath%`n count++ } } if count = ; no audio files found return sort, filelist filedelete, %m3u% fileappend, #EXTM3U`n%filelist%, %m3u% } return
Compiled:
REGEDIT4 [HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist] @="Create Playlist" [HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist\command] @="\"x:\\path to exe\\create m3u.exe\" \"%1\""
Uncompiled:
REGEDIT4 [HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist] @="Create Playlist" [HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist\command] @="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"x:\\create playlist.ahk\" \"%1\""