I am wanting to help iTunes sort properly.

At the moment (default sorting) iTunes sorts like this:

If Artist name starts with either "A" or "The" (are there more? I only know of these two) iTunes ignores these.

Example

- "A Perfect Circle" doesn't get sorted to 'A' but instead to 'P'
- "The Beatles" doesn't get sorted to 'T' but instead to 'B'

Now I like how iTunes sorts the artists that contain "The" but not "A".

I would like "A Perfect Circle" to be sorted to 'A', but "The Beatles" to be sorted to 'B'.

Now this involves using the tag field PERFORMERSORTORDER.

But I also need an IF function to help me out.

It would search the %artist% field for "The" (which will always be Mixed caps ie not: the, tHe, thE, THe, tHE, ThE, THE; and will always be the first three letters if the %artist% string was to contain one; but not neccessarily the only "The" within the string though).

If the function found a "The" then it would use the %artist% string value, minus the "The", as the value in the PERFORMERSORTORDER tag ("The Beatles" becomes "Beatles"). If it didn't find "The" than it would just use the %artist% string value as it is ("A Perfect Circle" stays as "A Perfect Circle").

Make any sence?

Any help would be much appreciated!