Issue With File Naming Script

I have a few hundred country single tracks that I want segregated from my main library. I have set up a separate script to put them in a different folder.

A lot of these albums have “Various Artists” as the album artist, and I would rather group them with their respective track artist. I have written the script for it, but none of my if statements seem to be registering. I have attached a couple examples.

The simple layout is “put the track in the main artists folder if it is on a various artist release, and append the artist(s) to the tracks if the track artist is different from the album artist.”

It doesn’t seem to be working as I intended, and I truly do not know where the issue lies. Is anyone able to see where the issues may be?

Welcome to the community.

The problem is the spaces after the commas in your comparison $eq() and option $and() and $or() statements. For example, it is trying to compare the value “Various Artists” with " Various Artists", and they are not matching because of the extra space. If you remove the extra spaces, the scripts should work as expected.

1 Like

I have a few hundred country single tracks that I want segregated from my main library. I have set up a separate script to put them in a different folder.

A lot of these albums have “Various Artists” as the album artist, and I would rather group them with their respective track artist. I have written the script for it, but none of my if statements seem to be registering. I have attached a couple examples.

The simple layout is “put the track in the main artists folder if it is on a various artist release, and append the artist(s) to the tracks if the track artist is different from the album artist.”

It doesn’t seem to be working as I intended, and I truly do not know where the issue lies. Is anyone able to see where the issues may be?

Remove the spaces behind the commas in the function parameters. Those are interpreted as part of the data passed.

1 Like

Just noticed there were too similar topics and @rdswift already answered. I merged the topics now.

1 Like

That seems to be a common mistake (and even more common as people use AI to generate their scripts). I wonder if it’s worth adding something to the FAQ section of the documentation.

2 Likes

I think yes, as part of the scripting documentation we should mention this somehow.

I entered a ticket so that this doesn’t get forgotten.

1 Like