Export to custom playlist


#1

Hello,
First I want to say I really enjoy mp3tag. It's a superb application and I keep finding uses for it.
Lately I wanted to start using the export function as I have tons BUT really TONS of albums to organize and create the playlist for them. Most of my albums are already organized but the tags need cleaning.

Here's my mte script and an example of what it does

$filename(C:\Documents and Settings\polobunny\Desktop\\%artist% - %album% (%year%).m3u)#EXTM3U
$loop(%track%)$loop(%_filename_ext%)#EXTINF:%_length_seconds%,%artist% - %title%
%_filename_ext%
$loopend()$loopend()

Example

#EXTM3U
#EXTINF:239,Alicia Keys - No One
Alicia Keys - No One.mp3
#EXTINF:252,Chris Brown Ft. T-Pain - Kiss Kiss
Chris Brown Ft. T-Pain - Kiss Kiss.mp3
#EXTINF:208,Kanye West Ft. T-Pain - Good Life
Kanye West Ft. T-Pain - Good Life.mp3

The first line creates a m3u file with Artist - Album (Year) as the filename on my desktop. All is fine from there.
Second line creats the necessary playlist information to be "conventional" to my needs
The third line creates the location of the files according to the location of the playlist, that's where I need help

My music is organized in 4 subfolders, "0 - E", "F - K", "L - R" and "S - Z". My m3u playlists are in the same folder as those 4 folders.
This is what I would like my playlists to look like

#EXTM3U
#EXTINF:239,Alicia Keys - No One
0 - E\Alicia Keys - No One.mp3
#EXTINF:252,Chris Brown Ft. T-Pain - Kiss Kiss
0 - E\Chris Brown Ft. T-Pain - Kiss Kiss.mp3
#EXTINF:208,Kanye West Ft. T-Pain - Good Life
F - K\Kanye West Ft. T-Pain - Good Life.mp3

So I would like my mte script to automatically detect the first letter of the filename of each file and append the proper folder before it. I've been thinking about this all night and can't frankly sort it out. This would greatly help me as I have several thousands of files to organize.

Thank you for your time


#2

In line 3 use %_parent_directory%\%_filename_ext% or %_filename_rel%


#3

The following expression returns a category string in relation to the first letter of the filename, adapt it to your needs. $ifgreater($strchr('0123456789',$left(%_FILENAME%,1)),0,'0 - 9',$ifgreater($strchr('ABCDEabcde',$left(%_FILENAME%,1)),0,'A - E',$ifgreater($strchr('FGHIJKfghijk',$left(%_FILENAME%,1)),0,'F - K',$ifgreater($strchr('LMNOPQRlmnopqr',$left(%_FILENAME%,1)),0,'L - R',$ifgreater($strchr('STUVWXYZstuvwxyz',$left(%_FILENAME%,1)),0,'S - Z','Special')))))

DD.20071228.1439.CET


Renaming: Create grouping directories of 3 letters
#4

The problem is that the mp3 files are not necessarily in the folders were they normally end when I tag them. Most of the time i'll tag them from my desktop, so I cannot use %_parent_directory% here.

Thank you. This is something like that I was searching for, but I had a hard time thinking about how I could do it. I will check this soon and come back to you. :slight_smile:

EDIT:
Thank you so much DetlevD, yo have no idea how much time you just made me save. I'm close to fully automating the process of renaming all the music I get then creating the proper playlist in just a few clicks.
Here is my code, for the sake of it.

$filename(C:\Documents and Settings\polobunny\Desktop\\%artist% - %album% (%year%).m3u)#EXTM3U
$loop(%track%)$loop(%_filename_ext%)#EXTINF:%_length_seconds%,%artist% - %title%
$ifgreater($strchr('0123456789ABCDEabcde',$left(%_FILENAME%,1)),0,'0 - E',$ifgreater($strchr('FGHIJKfghijk',$left(%_FILENAME%,1)),0,'F - K',$ifgreater($strchr('LMNOPQRlmnopqr',$left(%_FILENAME%,1)),0,'L - R',$ifgreater($strchr('STUVWXYZstuvwxyz',$left(%_FILENAME%,1)),0,'S - Z','Special'))))\\%_filename_ext%
$loopend()$loopend()

Thanks DetlevD

:smiley: