Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Winamp 5, move mp3 to delete directory


  • Please log in to reply
11 replies to this topic
jamestr
  • Members
  • 98 posts
  • Last active: Jul 03 2008 12:30 AM
  • Joined: 05 Apr 2004
Winamp 5 has a built-in hotkey that puts the mp3 filename (the playing mp3) in the clipboard.

This lets me hear and move, "junk" songs to a delete directory

Note that the "send ^c" is required for this to work. not sure why since ^+0 populates the clipboard.

^m::
	send, ^+0					;winamp5 hotkey (place mp3 filename in clipb)
	sleep 100
	PostMessage, 0x111, 40048, , ,Winamp	 ;skip to next song
	;clipwait
	send ^c									;required command ?
	FileMove, %clipboard%, f:\aMp3\delete	; move mp3 to delete dir
return
[/quote]

dg_210
  • Guests
  • Last active:
  • Joined: --
hello

newbie here but cld somebody tellme how do u use this script....i.e. whatd i do after i run it...u kno to execute the script so that it can delete the song as all this scrpt does is set in the taskbar

Script lines most recently executed (oldest first). Press [F5] to refresh.
The seconds elapsed between a line and the one after it is in parens to the right (if not 0).
The bottommost line's elapsed time is the number of seconds since it executed.

001: Return (120.08)

Press [F5] to refresh.


and shows this on opening it up...

thnx
dg_210

Marre
  • Members
  • 2 posts
  • Last active: Sep 27 2005 10:14 AM
  • Joined: 31 Jan 2005
Hi,

Modified this script to copy the currently playing song to a "favorites" directory..

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copy the file playing in winamp to a directory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^m::
   ;winamp5 hotkey ^+0 (place mp3 filename in clipb)
   send, ^+0
   sleep 100
   ; copy mp3 to favorites dir
   FileCopy, %clipboard%, c:\music\_favorites   
return

The ^c that you had in your script doesn't seem to be needed.

Thanks for the idea!

/Martin

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Phantom lurker! :twisted: 8)

:lol:

n00kie
  • Guests
  • Last active:
  • Joined: --
Took your script and modified it to work with hidden winamp with Global Hotkeys enabled as follows:
Playback: Next in play list - Ctrl + Alt + Page Down
Playback: Previous in play list - Ctrl + Alt + Page Up
General: Copy file path - Ctrl + Alt + F12

;Delete current song to folder
^Del::
Send, ^!{F12} ;winamp5 hotkey (place mp3 filename in clipb)
Sleep 100
Send ^!{PgDn}
FileMove, %clipboard%, D:\Media\Audio\!del ; move mp3 to delete dir
return

Hope this helps.
Thanks

Industry
  • Members
  • 44 posts
  • Last active: Nov 21 2019 04:04 PM
  • Joined: 14 Jan 2007
I'm running Winamp 5.23 and I have not seen a hotkey copy the path of the file being played to clipboard for quite a while. I think this functionality is gone...

BoBo
  • Guests
  • Last active:
  • Joined: --
@ to whom it may concern
I've dropped 2 WinAMP postings at the Utilities section (yesterday) which might be of interest.

Industry
  • Members
  • 44 posts
  • Last active: Nov 21 2019 04:04 PM
  • Joined: 14 Jan 2007
I thought it wouldn't hurt to post my code, so here goes.

This sets up a hotkey (Ctrl + Shift + d) to move playback to the next track, delete the one that was playing, and remove it from the playlist

^+d::
SendMessage, 0x400,0,120,,ahk_class Winamp v1.x ;Writes current playlist to <winampdir>\Winamp.m3u and returns the current track number as the variable ErrorLevel (with the first track being 0)
FileReadLine, CurrentSongLocation, %ProgramFiles%\Winamp\winamp.m3u,  ( ErrorLevel + 1) * 2 + 1 ;Reads the location of the currently playing song and adjusts the linenumber based on the format of the m3u
PostMessage, 0x111,40048,,,ahk_class Winamp v1.x ;Plays next song
FileRecycle, C:%CurrentSongLocation% ;Deletes previous song (C: needs to be appended because of the format of the m3u)
PostMessage, 0x111,40222,,,ahk_class Winamp PE ;Empties missing files from playlist
return

Things this simple script doesn't account for:
You already have Ctrl + Shift + d as a hotkey
Winamp isn't located in Program Files\Winamp\Winamp.exe
Your mp3 files that are on your playlist aren't on your C:\ drive
You have other tracks on your playlist that no longer exist but you don't want them removed (The script removes _all_ missing files from the playlist, not just the one it removes)
Your winamp writes the winamp.m3u file differently than mine does (?)

These are all things that might hinder the correct functioning of the script so look out for them. Sorry for doing a half-a$$ed job -- it appears there are other (better) scripts out there for the same purpose.

Enjoy

Industry
  • Members
  • 44 posts
  • Last active: Nov 21 2019 04:04 PM
  • Joined: 14 Jan 2007
Added support for files on multiple drives. I'm using winamp version 5.35 just in case it stops working in future version.. it's an fyi

^+d::
  SendMessage, 0x400,0,120,,ahk_class Winamp v1.x ;Writes current playlist to <winampdir>\Winamp.m3u and returns the current track number as the variable ErrorLevel (with the first track being 0)
  FileReadLine, CurrentSongLocation, %ProgramFiles%\Winamp\winamp.m3u,  ( ErrorLevel + 1) * 2 + 1 ;Reads the location of the currently playing song and adjusts the linenumber based on the format of the m3u
  StringLeft, FirstLetter, CurrentSongLocation, 1
  PostMessage, 0x111,40048,,,ahk_class Winamp v1.x ;Plays next song
  if FirstLetter != "\" ;If the track is on drive C: the drive letter is omitted
  {
    FileRecycle, %CurrentSongLocation% ;Deletes previous song from other drive
  }
  else
  {
    FileRecycle, C:%CurrentSongLocation% ;Deletes previous song from C: drive
    return
  }
  PostMessage, 0x111,40222,,,ahk_class Winamp PE ;Empties missing files from playlist 
  return


Industry
  • Members
  • 44 posts
  • Last active: Nov 21 2019 04:04 PM
  • Joined: 14 Jan 2007
This is a better, updated version that works with Winamp 5.5 now:

^+d::
  IfWinExist, iTunes
    Run, %A_ScriptDir%\iTunesDelete.au3
  Else
  {
  SendMessage, 0x400,0,120,,ahk_class Winamp v1.x ;Writes current playlist to <winampdir>\Winamp.m3u and returns the current track number as the variable ErrorLevel (with the first track being 0)
  FileReadLine, CurrentSongLocation, %ProgramFiles%\Winamp\winamp.m3u,  ( ErrorLevel  * 2 ) + 3 ;Reads the location of the currently playing song and adjusts the linenumber based on the format of the m3u
  StringLeft, FirstLetter, CurrentSongLocation, 1 ;Used to determine what drive the track is on
  PostMessage, 0x111,40048,,,ahk_class Winamp v1.x ;Plays next song
  IfEqual, FirstLetter, \ ;If the track is on drive C:, Winamp omits the drive letter in the m3u so we check to see if it is on the C: drive
  {
   FileRecycle, C:%CurrentSongLocation% ;Deletes song from C: drive
  }
  else
  {
   FileRecycle, %CurrentSongLocation% ;Deletes song from other drive
  }
  IfWinExist, ahk_class BaseWindow_RootWnd
   ControlSend, Winamp Playlist Editor, !{DEL} ;Empties missing files from playlist 
  }
  return


shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
This is built on the great work of giants.. i just put it together..

slight quirk: the remove missing file works only after such a long sleep :( and does not in windowshade mode.. any help appreciated, esp. from VxE

#del:: ;Delete currently playing track from disk (Winamp)
CurrentSongPath := GetWinampTrackInfo("path")
PostMessage, 0x111,40048,,,ahk_class Winamp v1.x ;Plays next song
FileRecycle, %CurrentSongPath% ;Recycle song
sleep 10000
IfWinExist, ahk_class BaseWindow_RootWnd
 ControlSend,Winamp Playlist Editor,!{DEL}  ;Remove missing files from playlist
return


GetWinampTrackInfo( Mode="Title", Track="Current" )
{ ; Function by [VxE]. Version 0.1
   Window = ahk_class Winamp v1.x
   Message = 211
   SendMessage, 0x400, 0, 125, , %Window%
   IfEqual, ErrorLevel, Fail, Return
   IfEqual, Track, Current, SetEnv, Track, %errorlevel%
   Else   EnvSub, Track, % Track > 0
   If InStr(Mode, "t") = 1
      message += 1
   SendMessage, 0x400, %Track%, %message%,, %Window%
   index := errorlevel
   winget, pid, PID, %Window%
   hProcess := DllCall("OpenProcess","Int",16,"Int",0,"UInt",pid)
   VarSetCapacity(MVALUE,1,0)
   Loop, 255 ; can be bigger if truly necessary
   {
      DllCall("ReadProcessMemory","UInt",hProcess
      ,"UInt",index+A_Index-1,"Str",MVALUE,"UInt",1,"UInt *",0)
      IfEqual, MValue,, Break ; null terminate string
      str .= MValue
   }
   DllCall("CloseHandle", "UInt", hProcess)
   return %str%
}

If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Industry
  • Members
  • 44 posts
  • Last active: Nov 21 2019 04:04 PM
  • Joined: 14 Jan 2007
This problem has been plaguing me with my script too. I figured out that if winamp is active and the playlist has focus, then doing a PostMessage and sending !{DEL} works just fine but if it's not active then there's always trouble.
Here is the best solution I could find. As far as I've tested, it's works all of the time even if Winamp is minimized (v 5.551)

IfWinExist, ahk_class BaseWindow_RootWnd
    {
      WinActivate, ahk_class BaseWindow_RootWnd
      ControlClick,,, Playlist Editor
      Send, {Alt Down}{DEL}{Alt Up}
    }

Here's another script I thought of that seems to work well. It requires you to enable Winamp's Global Hotkeys and create a new hotkey for Copy file path (unicode). I set mine up randomly as ^!+7. This will skip the steps of having to write the .m3u file to the disk and reading it, although it uses the clipboard so you'll want to put whatever was in the clipboard before back by temporarily storing it

^+d::
  ClipStore := ClipboardAll				; Save the entire clipboard to a variable of your choice.
  Clipboard =
  Send, ^!+7 						; Winamp Global Hotkey for "Copy file path (unicode)"
  ClipWait
  PostMessage, 0x111,40048,,,ahk_class Winamp v1.x 	; Plays next song
  FileRecycle, %Clipboard%

  IfWinExist, ahk_class BaseWindow_RootWnd
  {
    ControlSend, Winamp PE1, !{DEL} 			; Remove missing files from playlist
  }

  Clipboard := ClipStore   				; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
  ClipStore =   					; Free the memory in case the clipboard was very large.
  return