Remove/Delete Now Playing

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Remove/Delete Now Playing

Post by Teknojnky »

WARNING THIS SCRIPT CAN PERMANENTLY DELETE TRACKS WITH NO CONFIRMATION USE AT YOUR OWN RISK!!!!!

This script will allow you to create a hotkey to quickly remove or permanently delete the currently playing track.

There is no confirmation, so don't blame me if you accidently delete something you don't want to. As a safeguard, the deleted track is put in the recycle bin.

The 2nd menu isn't working, I did not see any way to remove a track from the library without deleting permanently (at least without doing sql).

I tested with some junk files and it seem to work ok, please do the same.

To create hotkey, go to tools > options > general > hotkeys >

action: general : execute scripts : script function
hotkey: press selected hotkey buttons

since this is an advanced and risky script, you will have to know what you are doing and manually add it to mediamonkey, no install or MMIP file will be created for it.

Code: Select all

Option Explicit
'==========================================================================
'
' MediaMonkey Script
'
' SCRIPTNAME: Delete Now Playing
' DEVELOPMENT STARTED: 2009.09.28
  Dim Version : Version = "2009.09.28.1500"

' DESCRIPTION: Removes/deletes currently playing track
' FORUM THREAD: 
' 
' WARNING THIS SCRIPT CAN DELETE PERMANENTLY FILES WITH NO CONFIRMATION
' USE AT YOUR OWN RISK I AM NOT RESPONSIBLE FOR ANY DAMAGES OR LOSSES'

' INSTALL:
' - Save script to mediamonkey\scripts\deletenowplaying.vbs
' - add entries to scripts.ini'

' [RemoveNP]
' Filename=deletenowplaying.vbs
' ProcName=RemoveNowPlaying
' DisplayName=Remove Now Playing Song from player
' Language=VBScript
' ScriptType=0
' 
' [RemoveNPLib]
' Filename=deletenowplaying.vbs
' ProcName=DeleteNowPlayingFromLib
' DisplayName=Removes Now Playing Song from Library
' Language=VBScript
' ScriptType=0
' 
' [RemoveNPPerm]
' Filename=deletenowplaying.vbs
' ProcName=DeleteNowPlayingPermanently
' DisplayName=Deletes Now Playing Song PERMANENTLY
' Language=VBScript
' ScriptType=0




Sub RemoveNowPlaying()
  'removes from now playing (no delete)'
  Dim NPSong
  Set NPSong = SDB.Player.CurrentSong
  
  If Not NPSong is Nothing Then
    SDB.Player.PlaylistDelete SDB.Player.CurrentSongIndex
    SDB.Player.Next
  End If
  
End Sub

Sub DeleteNowPlayingFromLib()
  'removes now playing song from library (not from drive)'
  'not finished'
'   Dim NPSong
'   Set NPSong = SDB.Player.CurrentSong
'   
'   If Not NPSong is Nothing Then
'     SDB.Player.PlaylistDelete SDB.Player.CurrentSongIndex
'     SDB.Player.Next
'     
'     'Didnt see any way to delete from library without perm delete'
'   End If
  
End Sub

Sub DeleteNowPlayingPermanently()
  'permanently deletes song from NP, Lib and drive'
  
  Dim NPSong
  Set NPSong = SDB.Player.CurrentSong
  
  If Not NPSong is Nothing Then
    Dim DeleteList
    Set DeleteList = SDB.NewSongList
    DeleteList.Add NPSong
    SDB.Player.PlaylistDelete SDB.Player.CurrentSongIndex
    SDB.Player.Next
    
    SDB.Tools.DeleteTracks DeleteList,False,1

  End If


End Sub
debu
Posts: 159
Joined: Fri May 11, 2007 9:52 pm

Re: Remove/Delete Now Playing

Post by debu »

thanks for this. I copied the code into a .vbs and put it in the auto scripts folder, closed mm3, reopened and went to create a hotkey, but the problem is under the "execute script" there isn't a "delete now playing" (what I saved script as). Can you see any step I'm missing here?
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Remove/Delete Now Playing

Post by Teknojnky »

' INSTALL:
' - Save script to mediamonkey\scripts\deletenowplaying.vbs
' - add entries to scripts.ini'
debu
Posts: 159
Joined: Fri May 11, 2007 9:52 pm

Re: Remove/Delete Now Playing

Post by debu »

ok thanks, just learning here.. is this what I add to the .ini:

' [RemoveNP]
' Filename=deletenowplaying.vbs
' ProcName=RemoveNowPlaying
' DisplayName=Remove Now Playing Song from player
' Language=VBScript
' ScriptType=0
'
' [RemoveNPLib]
' Filename=deletenowplaying.vbs
' ProcName=DeleteNowPlayingFromLib
' DisplayName=Removes Now Playing Song from Library
' Language=VBScript
' ScriptType=0
'
' [RemoveNPPerm]
' Filename=deletenowplaying.vbs
' ProcName=DeleteNowPlayingPermanently
' DisplayName=Deletes Now Playing Song PERMANENTLY
' Language=VBScript
' ScriptType=0

? thanks again
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Remove/Delete Now Playing

Post by Teknojnky »

minus the apostraphes

and you don't really need RemoveNPLib since it doesn't do anything at the moment.

and MM needs to be closed when you edit scripts.ini
debu
Posts: 159
Joined: Fri May 11, 2007 9:52 pm

Re: Remove/Delete Now Playing

Post by debu »

Here's what's coming up after I added the hotkey:

File: C:\program files\ MediaMonkey \ Scripts\ deletenowplaying.vbs cannot be opened:
The file is unavailable or you may not have permission to access it.

Hit "ignore" and got:

Error #13 Microsoft VBscript runtime error
Type mismatch : 'DeletenowPlayingPermanently'
File: "C:\Program Files\ MediaMonkey \Scripts \ deletenowplaying.vbs", Line: 1, Column 0
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Remove/Delete Now Playing

Post by nohitter151 »

debu wrote:Here's what's coming up after I added the hotkey:

File: C:\program files\ MediaMonkey \ Scripts\ deletenowplaying.vbs cannot be opened:
The file is unavailable or you may not have permission to access it.

Hit "ignore" and got:

Error #13 Microsoft VBscript runtime error
Type mismatch : 'DeletenowPlayingPermanently'
File: "C:\Program Files\ MediaMonkey \Scripts \ deletenowplaying.vbs", Line: 1, Column 0
Check that the file is actually named deletenowplaying.vbs and not deletenowplaying.vbs.txt.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
debu
Posts: 159
Joined: Fri May 11, 2007 9:52 pm

Re: Remove/Delete Now Playing

Post by debu »

saved as "deletenowplaying.vbs" in my scripts/auto

still get the same error. any suggestions?
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Remove/Delete Now Playing

Post by nynaevelan »

debu wrote:saved as "deletenowplaying.vbs" in my scripts/auto

still get the same error. any suggestions?
It should be in the \Scripts\ folder not the \Scripts\Auto\ folder. :wink:
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
debu
Posts: 159
Joined: Fri May 11, 2007 9:52 pm

Re: Remove/Delete Now Playing

Post by debu »

@nynaevelan cheers. Thanks Teknojnky for the script, I was going to donate a few bucks but couldn't see a donate on your page...
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Remove/Delete Now Playing

Post by Teknojnky »

No need, its really so easy that anyone could do it.
howto
Posts: 2
Joined: Sun Sep 13, 2009 2:47 pm

Re: Remove/Delete Now Playing

Post by howto »

awesome! thanks man. i'll try it out after work today
Guest

Re: Remove/Delete Now Playing

Post by Guest »

"really so easy that anyone could do it."

Wish I could do it... much les get it to wok. :(
gooeywooey

Re: Remove/Delete Now Playing

Post by gooeywooey »

Hello,

Does anyone still use this script? deletenowplaying.vbs?

I get error #438, object doesn't support this property or method 'SDB'
line 1, column 0,

Any help would be greatly appreciated.
Sorok7

Re: Remove/Delete Now Playing

Post by Sorok7 »

Thanx! Greate work!
Post Reply