Move a file to another directory without losing MediaLibrary info

This script will currently work only with the CVS version of ActiveWinamp

When you simply move a media file, it loses its connection to the WinAmp Media Library and so you lose your rating/lastplayed/playcount information.

This script moves the files safely.

'By Vitaly Belman
 
MoveFolder = "E:\My Documents\6 Mp3" 'The folder you move stuff to
 
Set wo = CreateObject("ActiveWinamp.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim SendItems
SendItems = GetSendToItems
If ubound(SendItems,1) > 0 Then
 
	for each track in SendItems
 
		NewFilename = track.filename
		LastSlashPos = InStrRev(NewFilename, "\")
		NewFilename = Mid(NewFilename, LastSlashPos)
		NewFilename = MoveFolder + NewFilename
		
		call fso.MoveFile(track.filename, NewFilename)
 
		Set NewItem = wo.LoadItem(NewFilename)
		NewItem.CloneFrom(track)
		wo.MediaLibrary.Insert(NewItem)
		wo.MediaLibrary.Delete(track.filename)
 
	next
 
end if
 
quit

- Vitaly Belman

 
examples/playlist/move_a_file_to_another_directory_without_losing_medialibrary_info.txt · Last modified: 2006/11/06 15:44
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Music Plugins