Create filename using $replace

Hi
I'm trying to generate a filename for playlists for each album. The code below works - ie the replacement of the / and : with a - works as does the double quotes with 2 singles, but the code where I am trying to replace 3 dots at the end of an album string with nothing does not work.
So if the album tag is "For All We Shared..." I want the filename of the playlist to be "For All We Shared.m3u8"

$filename(%_folderpath%$replace(%albumartist% - $cutleft(%album%,6),$eql($right(%album%,3),...),,/,-,:, -,",'').m3u8,utf-8)

Any ideas what this code should be please
Thanks
G

you can test expression in Convert>Tag-Tag.
Have you tested $eql($right(%album%,3),...)?
The result is a boolean value, no string. You would have to supply the string now - probably in a $if() statement.
Anyway: why so complicated? Why don't you replace sinply 3 dots with nothing?
$replace(%albumartist% - $cutleft(%album%,6),...,,/,-,:, -,",'')

Thanks, I only want to replace the 3 dots with nothing if they appear at the end of the album title, but not anywhere else

Are you also sure about the $cutleft()
E.g. and album like "... and then there were three ..."
would be come
"d then there were three ..."
plus the removal of the trailing dots:
"d then there were three "

To compare strings: $if($eql(string1,string2),true do this,false do this)
$if($eql($right(%album%,3),...),...,)

You had a correct syntax in this thread:

Thanks. This works. The reason I use $cutleft is because all my albums have the year, colon and space appended at the front of them so they show up in correct order on an iPod/iPhone etc. Even though I have an albumsort tag I like to see the year and album was released when playing it. I didn't want this to appear at the front of the playlist name

Thanks again

Hi, just realised I need to do the same for 2 dots (easy now) but also a single dot - which is proving a problem. I'm guessing this is because a single dot is a reserved character so the following does not work:

$if($eql($right(%album%,1),.),.,)

Have tried the following but this also does not work
$if($eql($right(%album%,1),\.),\.,)

How do I get it to recognise the single dot?

What do you mean by

$if($eql($right(any string...,1),.),.,)
produces, as it should, a "." as result.
Now you have to replace it.

Basically its replacing all instances of a single dot in the filename. So "Born in the U.S.A." becomes "Born in the USA.m3u8 rather than "Born in the U.S.A.m3u8
I have rechecked where there are 3 dots in an album title, where the 3 dots do NOT appear at the end and that works fine - i.e. the 3 dots are not replaced when not at the end but are replaced when at the end of the title

Code is now:

$filename(%_folderpath%$replace(%albumartist% - $cutleft(%album%,6),$if($eql($right(%album%,1),.),.,),,$if($eql($right(%album%,3),...),...,),,/,-,:, -,",'').m3u8,utf-8)

Any ideas?
G

Yes, this is logical as the test is "is there a dot at the end of ALBUM?" which it is.
And as now the dot gets restored, the replace instruction is: "replace a(ny) dot with nothing" which leads to the removal of all dots.
So perhaps you replace the dots as final step after you did all the other processing.

Something like:
$regexp($replace(%albumartist% - $cutleft(%album%,6),$if($eql($right(%album%,3),...),...,),,/,-,:, -,",''),(.*)\.$,$1)

Thanks for the suggestion. I managed to get this to work yesterday using a different technique - don't know why I didn't think of it before. Code below:

$filename(%_folderpath%$trimright($replace,%albumartist% - $cutleft(%album%,6),/,-,:, -),.).xxx,utf-8)

Thanks for your help
G