i like foo_run.dll and have writen a script to delete files on playing
Usage:
1. save the code below to foobar2000\scripts\delete_playing_file.vbs
2. configure Run sevices (foo_run.dll), add Delete Playing File:
3. assign a hotkey to this script, such as Ctrl + Del
4. play music now, and use Ctrl + Del to delete ugly songs ^i^
'*************************************************************************
' delete_playing_file.vbs
' version: 0.2.2
' update: 2006.6.15
' -- Scripted by lifesinger
'
' Usage:
' 1. place this script in foobar2000\scripts
' 2. configure Run sevices (foo_run.dll), see cfg_run.png
' 3. assign a hotkey to this script, such as Ctrl + Del
' 4. play music now, and use Ctrl + Del to delete ugly songs ^i^
' Home: [url=http://lifesinger.3322.org/]http://lifesinger.3322.org/[/url]
'*************************************************************************
Option Explicit
Const beQuiet = False ' If you are annoyed with any confirmation, please change False to True
'Get commandline arguments, if none, show tips and quit
Dim objArgs, filepath
Set objArgs = WScript.Arguments
If objArgs.Count <> 1 Then
msgbox "delete_playing_file.vbs: delete song on playing. " & _
vbNewLine & vbNewLine & _
" -- by lifesinger. Jun 16th, 2006 " & _
vbNewLine & vbNewLine & _
"Usage: delete_playing_file.vbs <file_path> " & _
vbNewLine, 64, "About"
Wscript.Quit
Else
filepath = objArgs(0)
End If
'**** DON'T EDIT BELOW ****
'-------------------------== CODE BEGIN ==----------------------------
Dim ScriptPath, fso, oShell, file_ext
ScriptPath = Left(WScript.ScriptFullName, (Len(WScript.ScriptFullName) - Len(WScript.ScriptName)))
Set oShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filepath)) Then
file_ext = LCase(Right(filepath, 3))
If file_ext = "cue" Then
oShell.Run Chr(34) & ScriptPath & "..\foobar2000.exe" & Chr(34) & "/command:Remove", 0, True ' Remove from playlist
WScript.Sleep 100
oShell.Run Chr(34) & ScriptPath & "..\foobar2000.exe" & Chr(34) & " /next", 0, True ' play next song
Else
oShell.Run Chr(34) & ScriptPath & "..\foobar2000.exe" & Chr(34) & " /next", 0, True ' play next song
WScript.Sleep 100
'del file
delete_file filepath
'remove dead items
oShell.Run Chr(34) & ScriptPath & "..\foobar2000.exe" & Chr(34) & " /command:" & Chr(34) & "Remove dead items"& Chr(34), 0, True
End If
Else
If Not beQuiet Then
MsgBox filepath & " is not existed." & _
vbNewLine & _
"Run Services(foo_run.dll) maybe is configured improperly. " & _
vbnewline & _
"Please check it -_-", 48, "error"
End If
End If
Set oShell = Nothing
Set fso = Nothing
WScript.Quit
'-------------------------== CODE END ==----------------------------
'---------------------------------------
Sub delete_file(filespec)
On Error Resume Next
Err.Clear
Dim r
r = vbNo
If Not beQuiet Then
r = MsgBox("This will delete 1 file:" & vbNewLine & vbNewLine & filespec & vbNewLine & vbNewLine & "Continue ?", vbYesNo + vbQuestion, "Warning")
End If
If r = vbYes Then
fso.DeleteFile filespec, True
Else
WScript.Quit
End If
If Err.Number <> 0 Then
' maybe filespec is the last file in the playlist
' so first stop it, and try delete again
oShell.Run Chr(34) & ScriptPath & "..\foobar2000.exe" & Chr(34) & " /stop", 0, True ' stop
WScript.Sleep 100
Err.Clear
fso.DeleteFile filespec, True
If Err.Number <> 0 Then
If Not beQuiet Then
MsgBox "Delete " & filespec & " failed." & vbNewLine & "I don't know why :(", 48, "error"
End If
End If
End If
On Error Goto 0
End Sub
'---------------------------------------
[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]Moderation: added codebox[/size]