File Name script assist, plz?

Likely a simple syntax I’m not aware of, but I wish to add a space at end of file name, before the extension. What I desire is: Artist - Title - Album - .ext

What I have for File Naming script is very basic (and works just fine) is:
$if(%artist%,%artist% - %title% - %album% -_)

How do I alter the script to replace the ‘_’ with an empty space? Merely putting a space after the last ‘-’ results in nothing after the last ‘-’ and the extension. i.e. - Artist - Title - Album -.ext

For now, I have a Quick Action in mp3tag that takes care of it, but would appreciate being able to do away with having to take another step.

Thanks - A.J

This actually could be something that’s currently not possible. I can definitely reproduce this. I haven’t looked into the details yet, but I wouldn’t be surprised if leading or trailing whitespace in file names gets intentionally cleared somewhere.

2 Likes

Yes, I am sure they are removed by Picard on some occasions.
I ran into this issue when using Picard Plugin: Format Performer Tags

When I used a script that achieved something similar, trailing spaces were respected.
But when using the plugin, trailing spaces are removed.
The plugin creator ( @rdswift ) had a look at this, but confirmed it must be something that Picard is doing.

It’s not a biggie, and there might be valid reasons for this behaviour, but personally I would be in favor of removing that mechanism. (not the spaces)

2 Likes

Actually, my finding was that the tag values were trimmed before being written to the file. I never checked on the file naming stuff.

Thanks for the replies. I agree it must be something in Picard, itself, as the only plugin I have in use is ‘Title Case’ and none of what I have in ‘My Scripts’ performs any trimming, other than for specific characters. My hope is that there is some way of forcing a filename trailing space.

Same here, I’m only talking about tags, not about file names.