Rename Files Script

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Rename Files Script

Post by Skywave » Sun Oct 15, 2006 5:47 am

I have searched this forum as best I could and could not find any script to rename files quickly.

Everytime I had to go to the Properties, and click the rename button, which took a long time because of the amount of songs I am sorting out.

So here is the Script:

' A simple script renames the file to "<Artist> - <Title>.<Ext>"

Code: Select all

Sub RenameFile
  ' Define variables
  Dim list, i, art, tit, ext

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.CurrentSongList 

  ' Process all selected tracks
  For i=0 To list.count-1
    Set itm = list.Item(i)

    ' Build the filename
    tit = itm.Title
    art = itm.ArtistName
    ext = right(itm.Path, 4)

    Rename the file
    itm.RenameByMask(art & " - " & tit & ext)
  Next

  ' Write all back to DB and update tags
  list.UpdateAll
End Sub

Here is the Scripts.ini Entry

Code: Select all

[RenameFile]
FileName=RenameFile.vbs
ProcName=RenameFile
Order=35
DisplayName=Rename File
Description=Renames the file to "<Artist> - <Title>.<Ext>"
Language=VBScript
ScriptType=0
Enjoy!

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Sun Oct 15, 2006 5:58 am

Oops... did you try "auto-organise" on all selected files, with the mask "<Artist> - <Title>" ?
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Post by Skywave » Sun Oct 15, 2006 6:03 am

So THAT is what Auto-Organise is for???

I assumed it was for organising the songs into seperate folders. Didn't know it does batch renaming as well...

Sorry. Thanx.

Post Reply