If Statement in Foobar2000 Tag Scripting

If Statement in Foobar2000 Tag Scripting

In foobar2000 I have a column called 'tempo' and another called 'value'. In the 'value' column I need a script that says:

If tempo tag contains the text 't-1', enter 99 into the value tag.
If tempo tag contains the text 't-2', enter 98 into the value tag.
If tempo tag contains the text 't-3', enter 97 into the value tag.

The following script is as far as I've got, but all this does is put 99 regardless of whether the text is t-1, t-2 or t-3:

$if($strchr($meta(tempo),t-1),99)

I'd be so grateful if someone could help me with this.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.