Shorten Filename Title with script


#1

I want to shorten long filenames to 64 characters by reducing the length of the title only e.g.

01 - This Track Has A Very, Very, Very, Very Long Title - Abba - The Best Of Abba.mp3
to
01 - This Track Has A Very, Very, - Abba - The Best Of Abba.mp3

Using Convert Filename - Filename I got this far:

%1 - $iflonger(%_filename_ext%,64, ????? ,%2) - %3 - %4

any help appreciated.

P.S. I don't want to rely on tag data at all.


#2

You may try:
%1 - $left(%2,$ifgreater($len(%1 - %2 - %3 - %4),60,$sub($len(%2),$sub($len(%1 - %2 - %3 - %4),60)),$len(%2))) - %3 - %4

This will result into a 64 character string:
"01 - This Track Has A Very, Very, - Abba - The Best Of Abba.mp3"

It seem that Mp3tag system placeholders like "%_filename_ext%" are not supported in converter filename-filename. I would suggest to use an action otherwise.

DD.20080908.1003.CEST


#3

Thanks DetlevD you rescued me again!

This works perfectly, as usual. :smiley: