Maximize number of characters in a file name?

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

MPG
Posts: 418
Joined: Tue May 13, 2008 11:22 pm

Maximize number of characters in a file name?

Post by MPG »

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
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Maximize number of characters in a file name?

Post by Teknojnky »

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.
MPG
Posts: 418
Joined: Tue May 13, 2008 11:22 pm

Post by MPG »

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
Humpty
Posts: 40
Joined: Wed Aug 18, 2004 1:04 am

Post by Humpty »

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.
MM3 monkey
Posts: 455
Joined: Mon Aug 27, 2007 2:34 am

Re: Maximize number of characters in a file name?

Post by MM3 monkey »

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?
kloggTunes
Posts: 1
Joined: Fri Jun 24, 2011 1:16 pm

Re: Maximize number of characters in a file name?

Post by kloggTunes »

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!!
MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

Re: Maximize number of characters in a file name?

Post by MMFrLife »

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 :)
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
Post Reply