Picard scripting: trimming trailing space inside brackets

You guys are really great for help out there. My next probably simple issue is I need VBR ] Bracket to be next to VBR when there is no value, here is my line:
[$if($eq($left(%_bitrate%,5),$right(%_bitrate%,5)),CBR $left(%_bitrate%,3),VBR %_bits_per_sample%)]
Example:
Good VBR with value -> [VBR 24]
Bad–> [VBR ]
Good - [VBR]
I like the space between the VBR and 24 and [CBR 320] but need to move the bracket over when there is no value like the example.

Use an if statement on the bits per sample variable and put the space inside it:

[$if($eq($left(%_bitrate%,5),$right(%_bitrate%,5)),CBR $left(%_bitrate%,3),VBR$if(%_bits_per_sample%, %_bits_per_sample%,))]
1 Like

WOW I thought that but didn’t try it, Thanks as usual :wink: