when i listen to music on my mobile, i just delete songs which i dont like from the playlist..
then i run this script on the saved playlist and it marks the songs that are not present in the playlist as deleted..
alongwith such a
script for PC (winamp) i can remove the songs i dont like from the disk!
i dont know how many will be benefited, but here's the code..
Code:
/*
; Select only files that are there in the specified .m3u playlist
; The other files will have an extension ".del" so that you know the deleted songs
*/
Inputfile = delete.m3u
ifnotexist, %Inputfile%
{
FileSelectFile, Inputfile,1,,Select playlist..,Playlists (*.m3u)
if Errorlevel
ExitApp
}
SplitPath, Inputfile,,,,,InDrive ;Get drive
if not InDrive
Splitpath,A_ScriptDir,,,,,InDrive
Loop, Read, %InputFile%
{
StringLeft, FirstLetter, A_LoopReadLine, 1
if FirstLetter=`#
continue
if FirstLetter=`\
FilePath := InDrive . A_LoopReadLine
else
FilePath := A_LoopReadLine
SplitPath, FilePath,,tPath
if tPath != oPath
{
oPath := tPath
if Paths
Paths .= "|" . oPath
else
Paths := oPath
}
FileMove, %FilePath%, %FilePath%.sel
}
if not Paths
Paths=|
Loop,Parse,Paths,|
{
Loop,%A_LoopField%\*.mp3
{
FileMove,%A_LoopFileFullPath%,%A_LoopFileFullPath%.del
}
}
Loop,Parse,Paths,|
{
Loop,%A_LoopField%\*.sel
{
StringTrimRight, restoreName, A_LoopFileFullPath, 4
FileMove,%A_LoopFileFullPath%,%restoreName%
}
}
_________________
If i've seen further it is by standing on the shoulders of giants
my site |
~shajul |
WYSIWYG BBCode Editor