Rename Files Script

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Rename Files Script

Post by Skywave »

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)

  ' Write all back to DB and update tags
End Sub

Here is the Scripts.ini Entry

Code: Select all

DisplayName=Rename File
Description=Renames the file to "<Artist> - <Title>.<Ext>"
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

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).
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Post by Skywave »

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