Total Noobs Needs Help With Renaming Song Titles

Hello, I would like to rename my song titles to match Spotify’s style for the benefit of Soundiiz. I find it is usually only needed for live tracks. I have two scenarios; one is that the way the song appears in Picard is something like “[Strutter (live in Paris, 1976)” whereas in Spotify it’s " Strutter - Live In Paris, 1976". So I would like to just replace “(” for "- " and remove the “)” . Of course, trying to write a replace script means I get unexpected character errors for ( and ). How do I make the script treat the parens like normal text and not script code?

The second scenario is very similar; sometimes Picard doesn’t have anything other than the song name, like " Letter to My Girlfriend" but Spotify it’s " Letter to My Girlfriend - Live at Carnegie Hall, New York, NY - October 1984". I just use $set(title,%title% - Live at Carnegie Hall, New York, NY - October 1984)) and apply to whatever songs as needed. But again, there are commas and I have to omit them to not get an error. I would like to retain the commas.

Thank you very very much for any help given. I can’t think of any other reason I would want to write scripts and really have no aptitude for them, I just need to get through this and I’m good.

You need to escape the characters with a backslash, e.g. \( or \) . Same if you want to use the dollar sign \$, percentage character \%, the comma \, or the backslash itself \\ .

3 Likes

Thank you very much for the help! I was able to come up with:
$set(title,$rreplace(%title%,[(],- ))
$set(title,$rreplace(%title%,[)],))
…and that did exactly what I needed. I do realize that this was certainly basic info to everyone here but I’ve never done this and other than a Google search for unexpected characters I didn’t know enough to know where to look. I doubt I’ll ever need to do a custom script again, so thanks for being patient and helping me quickly stumble my way to success!

2 Likes

In case there is a next time, this is actually included in a note in the Scripting portion of the Picard User Guide.

1 Like