#1 2012-09-25 19:36

Liachem
Member
Registered: 2012-09-25
Posts: 2

Renaming folders based on mp3 id3 tags

I was curious, is there a way to use Renamer to rename FOLDERS based on mp3 id3 tag info that is within the folder?
For example I would like my folders to be renamed as Artist - Album.
Can someone walk me through this if its possible?

Offline

#2 2012-09-25 19:56

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Renaming folders based on mp3 id3 tags

It is possible via PascalScript

There is one example here:
http://www.den4b.com/wiki/ReNamer:Scrip … MasterFile

Adapted into your description it would be something like:

const
  MASK = '*.mp3';
 
var
  MasterFile: WideString;
 
function FindMasterFile(const Folder: WideString): WideString;
var
  Files: TStringsArray;
begin 
  Result := '';
  SetLength(Files, 0);
  WideScanDirForFiles(Folder, Files,
    False, False, False, MASK);
  if Length(Files) > 0 then
    Result := Files[0];
end;
 
begin
  if WideDirectoryExists(FilePath) then
  begin
    MasterFile := FindMasterFile(FilePath);
    if MasterFile <> '' then
      FileName := CalculateMetaTag(MasterFile, 'ID3_Artist')
        + ' - ' + CalculateMetaTag(MasterFile, 'ID3_Album');
  end;
end.

This script deletes the previous name, if you want to have it back take a look ate the differences between the code on the wiki an this one, on the line "FileName := ...".

Also for details on how to add folders to the file list you can check the help on the filter settings http://www.den4b.com/wiki/ReNamer:Filte … lters_menu

If you have doubts just ask smile


If this software has helped you, consider getting your pro version. :)

Offline

#3 2012-09-25 20:10

Liachem
Member
Registered: 2012-09-25
Posts: 2

Re: Renaming folders based on mp3 id3 tags

Wow! it worked! thanks you have no idea how much time you just saved me! THANKS!

Offline

Board footer

Powered by FluxBB