Folders to Artist_Album_Track name workflow for Mac (tested OSX 10.15.7)

DISCLAIMER: This workflow is provided for free. It is not rock solid or utterly tested, so using it is on your own risk.

If you have a folder structure like this:

  • Music
    • Artist 1
      • Album A
        • Tråck 1.wav
        • Track 5.wav
        • Track 8.wav
    • Artist 2
      • Album B
        • Track 4.wav
      • Album C
        • Track 1.wav
        • Track 2.wav
        • Track 3.wav
    • Artist 3
      • Album D
        • Track 4.wav
        • Track 7.wav
      • Album E
        • Part 1
          • Track 1.wav
          • Track 2.wav
          • Track 3.wav

And you want this:

  • Music
    • Artist 1__Album A__Track 1.wav
    • Artist 1__Album A__Track 5.wav
    • Artist 1__Album A__Track 8.wav
    • Artist 2__Album B__Track 4.wav
    • Artist 2__Album C__Track 1.wav
    • Artist 2__Album C__Track 2.wav
    • Artist 2__Album C__Track 3.wav
    • Artist 3__Album D__Track 4.wav
    • Artist 3__Album D__Track 7.wav
    • Artist 3__Album E__Part 1__Track 1.wav
    • Artist 3__Album E__Part 1__Track 2.wav
    • Artist 3__Album E__Part 1__Track 3.wav

Then here is the program for you.

Simply install* this ‘workflow’ and then Control click (Right mouse click) the parent folder. (In this case ‘Music’). and choose ‘Services’ > ‘Folders to Artist_Album_Track name‘ from the contextual menu.

WHAT DOES IT DO? — read carefully!
– This script is an Apple Script run from within Automator workflow.
You can open it with Automator and tweak the script if you like.
This script works like this:
– It steps through every subfolder (artist names) and copies the artist name
– It steps through every subfolder of the artist folder (album names) and copies the album name.
– It steps through every album subfolder (if there is one) and copies its name.
– It steps through every track file and does the following:
—- It renames the track file to Artist__Album__Trackname. (can not be undone)
—- It checks if there are strange characters in the new name: éåç/(;’!@ etcetera. All these characters are replaced with a hyphen. (can not be undone)
(I did this because I use this for importing tracks in AVID. And AVID does not like file names containing such strange characters. Really, you’ll find out when you have to relink to such strangely named files.)
– Finally all tracks are moved out from the subfolders to the main folder (‘Music’) in the above example. (if you edit the script, you can disable this step)

Also, in the script itself there is the option to enable the function to delete all the now empty subfolders. You can open the .workflow file in Automator to do so. It is explained in one of the last lines in the script how to enable this setting. BE AWARE THAT THE SCRIPT DOES NOT CHECK IF THESE SUBFOLDERS ARE REALLY EMPTY. So you could delete some files accidentally!

– Download the zip file. (below)
– Double click the downloaded zip file.
– Double click the file ‘Folders to Artist_Album_Track.workflow’
– Apple will ask you if you want to install this service. Obviously: click Install.
– It can now be used as described under ‘HOW TO USE’

Have fun.

Rienk Leendertse
August 2021.