Amazon Ad2

Jan 12, 2011

Automatically delete duplicate songs in itunes

This next method uses VBScript and will only work for Windows users. If you are unfamiliar with VBScript, it's a coding language that allows you to make your own custom program for your PC. To run the duplicate song killer VBScript below, just follow these steps:
  • Click here to open the VBScript in a new browser window.
  • Copy and paste the script into a new Notepad document (Start > All Programs > Accessories > Notepad).
  • Edit line #2 and replace "DaCeige" with your username.DaCeige is the methodshop.com reader who wrote the script.
    • C:\Users\DaCeige\Music\iTunes\iTunes Music
  • Save the Notepad file using a file name like "DupKiller.vbs" Notepad will automatically try to add ".txt" to your text files. You MUST add the file extension ".vbs" to your file.
  • Double click on the file called "DupKiller.vbs" on your desktop. This will make a shortcut to the script.
  • That's it. Just double click on the shortcut for now on to run the script.
  • You may see a warning window from Norton AntiVirus when trying to run this script. Just select the option that allows this script to run. But always be cautious before running a VBScript. Never run a VBScript without inspecting it first. Many times people will try to hide viruses in VBScripts.
Here's the script below if you want to inspect it. Don't copy and paste this scriptimmediatelybelow. It won't work, it's just for display. Use the link above:
  1.  
  2. Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
  3. Set objFolder = objFSO.GetFolder("C:\Users\DaCeige\Music\iTunes\iTunes Music")
  4. Set colSubFolders = objFolder.Subfolders
  5.  
  6. 'get inside each artist's folder
  7. For Each objSubFolder in colSubFolders
  8.         'Wscript.Echo objSubFolder.Name
  9.         'once inside the folder do the following...
  10.         Set colSubSubFolders = objSubFolder.Subfolders
  11.         'Get inside each album folder
  12.         For Each objSubSubFolder in colSubSubFolders
  13.                 'once inside do the following
  14.                 'WScript.Echo vbtab & objSubSubFolder.name
  15.                 Set colMP3Files = objSubSubFolder.Files
  16.                 For Each objMP3File in colMP3Files
  17.                         'Wscript.Echo vbtab & objMP3File.Name
  18.                         strCurrentMP3Name = objMP3File.Name
  19.                         For Each objMP3File2 in colMP3Files
  20.                                 'Wscript.Echo Left(strCurrentMP3Name, Len(strCurrentMP3Name)-4) & vbtab & Left(objMP3File2.Name, Len(objMP3File2.Name)-6)
  21.                                 If UCase(Left(strCurrentMP3Name,Len(strCurrentMP3Name)-4)) =UCase(Left(objMP3File2.NameLen(objMP3File2.Name)-6)) Then
  22.                                        'Wscript.Echo(UCase(strCurrentMp3Name & vbtab & objMP3File2.Name))
  23.                                         'WScript.Echo objMP3File.Size & vbTab & objMP3File2.Size
  24.                                         WScript.Echo "1" & vbTab & objMP3File.Size & vbTab & UCase(strCurrentMp3Name)
  25.                                         WScript.Echo "2" & vbTab & objMP3File2.Size & vbTab & UCase(objMP3File2.Name)
  26.                                         MP3Size1 = objMP3File.Size
  27.                                         MP3Size2 = objMP3File2.Size
  28.                                         MP3SizeDiff = objMP3File.Size - objMP3File2.Size
  29.                                         WScript.Echo "-" & vbTab & MP3SizeDiff
  30.                                         If (MP3SizeDiff > -10000) Then
  31.                                                 WScript.Echo "*" & vbTab &"DELETE2" & vbTab & objMP3File2.Name
  32.                                                 objFSO.DeleteFile(objMP3File2.Path)
  33.                                         Else
  34.                                                 WScript.Echo "*" & vbTab &"DELETE1" & vbTab & objMP3File.Name
  35.                                                 objFSO.DeleteFile(objMP3File.Path)
  36.                                                 WScript.Echo "*" & vbTab &"RENAME" & vbTab & objMP3File2.Name & " -> " & strCurrentMP3Name
  37.                                                 objMP3File2.Name = strCurrentMP3Name
  38.                                         End If                                 
  39.                                         WScript.Echo " "
  40.                                 End If
  41.                         Next
  42.                 Next
  43.         Next
  44. Next


Read more:http://www.methodshop.com/gadgets/ipodsupport/duplicates/index.shtml#ixzz1Ar70rLTC

No comments:

Post a Comment