Limit ID tag if Char is "greater than"

I have a Clarion AutoPC that plays MP3s and it has a limited non scrolling title show feature from the ID tags. I want to limit the chars in the artist and title fields for my unique MP3 that I use in that system.

So I am using this:

Format Value: Title
Value: $left(%title%,18)..

As you an see it cuts the title at 18 chars from the left, but it also adds the ".." I want to show truncation on the display, but I am looking to add some intelligence so that the ..'s are not added unless the file was actually truncated.

Some files don't need the truncation, so I'm looking to crop at 18 and add .. for 20 chars total without a space after the last char.

Anyone have a thought on how to best achieve this as an Action?


Perhaps you find inspiration in this thread:



Following your idea, I came up with:

$iflonger(%title%, 18, $left(%title%,18)..,%title% )

The only issue I'm seeing now is that I'm getting a leading white space at the beginning of the char and white space at the end.

Not sure why it's adding the white space. What am I doing wrong?


The blank in front of the $left() is taken as an literal character.
The blank in front of the ) after %title% is taken as a literal character.

See what the expression in post #2 does for you.


Ok, so now when I remove the literal spaces the ".." are having a single white space added between the cropped title just before the appended ..

So instead of:


I'm getting:


Please show us the exact expression that you use.
(Or: did you try the expression in post #2?)

I copied and pasted the string you posted in #2


I found it's not an issue with the script, the last space is actually the 18th character. I'll look to see if the $trimRight can help fix this issue.

Here is my final fix that what works for my needs.


Thanks for all your help.