Naming Script Error

Hello, I’m using a script I found on the web for my library. It adds the release date to the left of the album title. It adds the date as " [1997] " but I’d prefer to use “(1997)” I found the code line and it’ll allow me to change the brackets to anything other than parentheses… Picard generates an error… I’m assuming it’s because of the way the code is using parentheses… does anyone know a workaround for this? Code below. Appreciate any help. I’ve spent hours on this and it’s way above my pay grade.

$set(getReleaseYear
,$if2(
		$if(%originalyear%,[$left(%originalyear%,4)] )
		,$if(%originaldate%,[$left(%originaldate%,4)] )
		,$if(%date%,[$left(%date%,4)] )
	)
type or paste code here

You just need to escape the brackets (as you would also have to do with a backslash, dollar sign and comma). This is explained in the Scripting section of the Picard User Guide.

Your revised script would be:

$set(getReleaseYear
,$if2(
		$if(%originalyear%,\($left(%originalyear%,4)\) )
		,$if(%originaldate%,\($left(%originaldate%,4)\) )
		,$if(%date%,\($left(%date%,4)\) )
	)
4 Likes

Thank you Sir! I’ll give it a go!

1 Like