Welcome Guest

Pages: 1
Truncating File Names
SnowdogPostJune 29, 2023, 04:37
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicTruncating File Names

I have a thing... It's not an action, it's something else. I think it's called a Rename Template and I think I made it with "tokens".

I have a bunch of them & they reside in a different place to the actions but I'm not really sure what the difference is.

The only ones I really use combine the Title with the Track & Disc numbers, across onto the file names so that they match. I have a version for two-number discs & a version for three-number discs, depending on the size of the set and I have a hyphen to substitute colons, as they can't be used in file names.

What I tend to do is complete the tagging & then use the command to perform the above action & have the file names match the Titles but yesterday, a bunch of the tracks (maybe about 10 out of over 5,000) couldn't complete because... I can't remember the error message but the bottom line is that the Titles were too long.

You can see one of the templates in the first screen shot & most of one of the super-long track Titles in the screen shots below.

Basically I'd rather just have Yate truncate the file names than have to go through manually & do it myself, and I'm wondering whether or not the "automatically truncate path components" setting will do that or whether it does something different? (The term "path components" worries me, as that's not necessarily the same as "file names".)

Image

Image

2MR2PostJune 29, 2023, 07:13
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicTruncating File Names

Actions are programs. Rename templates use tokens to graphically represent the pattern you want to use when renaming files and folders. ie. path components. All of the filesystems used or accessed by a Mac have restrictions on the length of path components and the full path. Your rename template can only have one path component that is too long and that's the filename which uses the Title field.

It can be difficult to determine if a filename or path component is too long for an underlying filesystem. The Automatically truncate path components setting attempts to remove some of the burden. When set, filenames and path components will be reduced to fit within 255 bytes based on the system's representation. Note that due to encodings, a truncated component may be less than 255 characters. Bytes were chosen as a unit, as APFS is based on UTF8 characters, HFS+ is based on UTF16 characters, etc. The setting errs on the side of caution. It is possible that extra characters can be manually entered when editing a path component in the Finder.

Setting automatically truncate path components will do what you want. It only truncates components which are longer than 255 bytes in length. If the combined length of the (Track Pad2) (Title) representation is more than 255 bytes, it will be truncated.

SnowdogPostJune 29, 2023, 08:26
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicTruncating File Names

Perfect, thanks yet again! 🙂

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.015 seconds.