Page 1 of 1

Rename & Move Parent folder based on folder content.

PostPosted: Sat Aug 25, 2012 3:59 pm
by MeyerMED
Short brief: Over time I have encoded my audio CD collection to FLAC. However, through the years, I have not maintained a consistant folder structure. Some folders are labeled one way, others labeled another. Inside the folders are the albums FLAC music files + cue + log.

Script help: What I want to do is for Hazel to go into album folder, read the file meta data, and rename the parent folder based on it. Note: all the meta data is intact on the albums.

Example:
[enter] Album folder ---> [read] FLAC meta data ---> [rename] Album folder (based on meta data): "Artist/Composer - Album Name (Year) [FLAC]" ---> [move] folder to "completed conversion" folder

Thanks in advance for the help!

Re: Rename & Move Parent folder based on folder content.

PostPosted: Mon Aug 27, 2012 3:05 pm
by Mr_Noodle
Assuming the metadata is accessible via Spotlight (not sure if you have a FLAC Spotlight importer installed), you can try something like:
Code: Select all
If (all) are met for any subfile
    Kind is FLAC
    Album matches •album
    Artist matches •artist
    Year matches •year

Then
    Rename  •artist - •album (•year)


I suggest searching the help for match patterns to understand how the matching stuff works. Just set those custom tokens to match anything. You'll need to tweak it a bit but what it's doing is matching folders which contain at least one FLAC file. The album/artist/year matching is more to snag that info so you can reuse it in the renaming pattern.