SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Scripter help to update Rating field from Genre

Hi,

I’ve tried searching for information on this, but I’m not getting any results and ChatGPT is also not coming up with much either. Is it possible to write a Scripter script that looks at information contained within the Genre field (a term “Rated 5”) and then updates the Rating field for the mp3?

If so, could someone please provide me with the script as I’ve all the ones I’ve attempted so far have failed.

Thanks

Can you post your existing script, is the script failing with error or does it seem to work but you are not seeing the changes in your music player app ?

I’ve tried a few variations but it keeps showing errors. I can’t work out what “contains” is as a command in JavaScript - chatgpt was fairly certain about it but I get the error message when trying to validate it in SongKong and have messed about with it so much now I’m not sure it would add much value to post it.

I understand the if statements but not a way to check if a field contains a certain value. Any ideas?

Ok here is a starting point that seems to work after modifying Example 1 so that Genre field is set to Rating 5

if(genre.contains('Rated 5')) { rating='5'};

image

Thanks so much! That’s done the trick and done exactly what I want with some additional tweaks. Thank you for the quick replies.

1 Like