I can't get this to work - I get an error message from either a folder or a file:
Code:
This file does not have a program associated with it for performing this action.Create an association in the Folder Options control panel
The .ahk script I'm using is
Code:
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 to C:\Program Files\m3uCreator\m3uCreator.exe and my reg file contains
Code:
REGEDIT4
[HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist]
@="Create Playlist"
[HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist\command]
@="\"C:\Program Files\m3uCreator\m3uCreator.exe\" \"%1\""
I'm sure I've done something really basic wrong - but what? Oh, yes, I did run the reg file
Thanks