However I am given the following message with the : highlighted...
Playlist - Filename:
Following characters are not allowed in file names: \\/:*?"<>|
Do you want it corrected automatically?
If I replace the : with an _, the string is accepted fine, and works as intended. This leads me to believe that if it would accept the string, the : would be replaced with a - as I intended. But, it won't allow me to put the : in the string.
Are you sure that the incriminating character is the colon and that it appears in ALBUM?
To write filenames without problematic characters, see $validate()
... and for a simpler expression, you could leave out the apostrophes in the $replace() call.
Oh, I see - this is just a stray error message.
If you use %albumartist% - %year% - $validate(%album%,-).m3u
it should work the way you want it.
Apparently, the plausibility check for the filename only checks for the colon anywhere in the filename definition and does not detect that the colon is part of a scripting function.
See, whether the suggestion with $validate() works
I think that the resulting string would be checked again against the rules.
But here, the syntax check does not see that the colon is nothing evil but something inside a scripting function. The error message and the offer to rectify the alleged mistake will lead to a disabled replace function.
Not sure about @ LyricsLover's comment. I dragged over an AC/DC album to see if it affected it, and it did not. It came out as AC-DC, which is what I want.
Any chance you (LyricsLover) have a good example routine I can try to illustrate what you're trying to say?
Thinking about what LyricsLover said, I can see scenarios where I'd like a different character to replace specific invalid characters. It doesn't seem $validate will do that. Working with it a bit has shown $validate is a bit of an all-or-nothing approach in practice.
It seems if it were possible to over-ride the plausibility check, $replace would work the way I originally intended.
Perhaps the devs would consider a soft warning that could be implemented rather than a forced cancel or auto-correct which removes the 'invalid' character?