I am having difficulty creating a file naming script for single vs multi-artist albums. My output goals are:

Single Artist
Album Artist\Year Album Title\Album Artist Year Album Title Track Number Track Title
Aerosmith\1989 Permanent Vacation\Aerosmith 1989 Pump 1-03 Going Down-Love In An Elevator.m4a

Various Artists
Album Artist\Year Album Title\Album Artist Year Album Title Track Number Track Artist Track Title
Various Artists\1977 Saturday Night Fever\Various Artists 1977 Saturday Night Fever 1-01 Bee Gees Stayin Alive.m4a

As you can see, I only want the track artist to appear before the track title in cases of multi-artist albums, otherwise it would be redundant. Thanks in advance for the help.