given a folder structure like this,
x:\cds\ARTIST1\ALBUM1\file.mp3
x:\cds\ARTIST1\ALBUM2\file.mp3
x:\cds\ARTIST2\ALBUM1\file.mp3
x:\cds\ARTIST2\ALBUM2\CD1\file.mp3
x:\cds\ARTIST2\ALBUM2\CD2\file.mp3
x:\cds\ARTIST2\OTHERFOLDER\no .mp3/.ogg/.wma/.wav files
...
the AHK script below takes a folder as input, counts the total number of artists, counts the total number of albums and output a list with this format:
total albums = XX
total artists = YY
-----------
ARTIST1
ALBUM1
ALBUM2
ARTIST2
ALBUM1
ALBUM2
...
script:
FileSelectFolder, xroot,,3, Select root CD folder. Example:
C:\rootCD`nThen click OK to run script
if xroot =
exitapp
Loop, %xroot%\*.* , 2, 0
{
xartist = %A_LoopFileName%
xtext = %xtext%%xartist%`n
xartistcount += 1
Loop, %xroot%\%xartist%\*.* , 2, 0
{
xalbum = %A_LoopFileName%
Loop, %xroot%\%xartist%\%xalbum%\*.*,,1 ;recursive file loop
{
if A_LoopFileExt not in mp3,ogg,wma,wav ;add ext. for other music file formats if needed
continue
xtext = %xtext%%A_space%%A_space%%xalbum%`n
xalbumcount += 1
break
}
}
}
xout = total albums = %xalbumcount%`ntotal artists = %xartistcount%`n-----------`n%xtext%
xfile = %A_Temp%\%A_Now%.txt
FileAppend, %xout%, %xfile%
run, %xfile%