Maximize number of characters in a file name?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Maximize number of characters in a file name?

Re: Maximize number of characters in a file name?

by MMFrLife » Tue Oct 19, 2021 6:48 pm

Looks useful, but shouldn't the title for this be:

Maximum number of characters in a filename?
(one is using this to trim down or set a maximum limit, right?)

Thanks for contributing, maybe I'll get around to trying it sometime :)

Re: Maximize number of characters in a file name?

by kloggTunes » Tue Oct 19, 2021 6:25 pm

Teknojnky wrote: Tue Jun 10, 2008 12:18 pm
you might be better off with putting left around your whole mask:

$left(<artist> - <title>,240)

this will keep the entire path under the limit for path/filename length without having to worry about any particular field.
13 years later, MM5 is out, and this is still the right answer. Thank you!!

Re: Maximize number of characters in a file name?

by MM3 monkey » Sun Dec 21, 2008 3:54 am

Teknojnky wrote: <artist> - $left(<title>,50)
Thank you very much. :)

I was using <Album:-10> in the file-name.

That way I can include in the file-name the first 10 characters of all albums (in case I lose the tags and the files get separated from their folders!] and, conveniently, the date of live concerts which have album names like "2008-12-20 - Whatever Place, Some City".

10 characters takes care of the date nicely but unfortunately albums that have less than 10 characters get padded with spaces. I was never sure if that might cause problems, but now it doesn't matter:

$left(<Album>,10)

is classy. 8)

Is there anywhere where all this sort of thing is documented? Like which fields can have multi-entries for example too?

by Humpty » Fri Jun 13, 2008 6:51 pm

I'd also like to know if there's some help file with all these functions documented. When I went into the Auto-Organize Files dialog and clicked on the ">>" button and looked at the help there $left wasn't listed.

For me the <filename:x> mask got changed from MediaMonkey 2 because in that version it wouldn't pad the filename if it were less than the limit you specified. Good thing I came here and stumbled upon the $left() function.

by MPG » Tue Jun 10, 2008 1:06 pm

Thanks Teknojnky,

I knew that the left function on the title would only affect the title, not the entire filename. I was just trying to figure out how to use the function.

$Left works.

Is there a listing somewhere of what functions can be used in Nodes or Organize files. I have read the Magic Nodes pdf, but even it is pretty sketchy at best.

Or are the vbscript functions availabe with the $sign in front of them?

eg: $UCase, $Mid, $Len, $InStr, etc...

TIA,
MPG

Re: Maximize number of characters in a file name?

by Teknojnky » Tue Jun 10, 2008 12:18 pm

MPG wrote:
I tried <artist> - left(<track#>, 50) but it doesn't work. Any suggestions?

TIA,
MPG
Er, that will limit the track# field, not the title...

<artist> - $left(<title>,50)

you need the $ on the command

you might be better off with putting left around your whole mask:

$left(<artist> - <title>,240)

this will keep the entire path under the limit for path/filename length without having to worry about any particular field.

Maximize number of characters in a file name?

by MPG » Tue Jun 10, 2008 12:12 pm

This was posted by elbuzzard in the News and Other Stuff Forum. I am looking for a solution as well.
Is there a way to limit the maximum number of characters in a title?

Say I organize my files to include the track title, I have a track title that is 1000 characters long. I don't want all of that in the filename, I'd like to trim it to around 150 characters.

I could use <Title:150> or <Title:-150>, but that will add a string of spaces to filenames where the title is shorter than 150 characters.

Is there a way to set the format to something like "If the title is longer than 150 characters, cut off everything after the 150th character, but otherwise, don't change it?"
I tried <artist> - left(<track#>, 50) but it doesn't work. Any suggestions?

TIA,
MPG

Top