Rename & Move Parent folder based on folder content.

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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!
MeyerMED
 
Posts: 2
Joined: Tue Dec 27, 2011 10:46 pm

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.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support