Move files to new folder with source folder name

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

Moderator: Mr_Noodle

Hey folks. I've got something I'd like to do that's a little beyond my skill level, thought I'd see if anyone had an idea on how to pull it off. I'm working on a film score and when I export my files from my DAW it puts them in an Mixdown folder. When I first export them they have a "==" on the end of the filename (an organizational thing I've done in Cubase), which then gets removed by Hazel to make them look nicer. The folder structure of each individual project is like this:

Main Project Folder
--Individual Cue Name (parent folder)
---- Mixdown (the folder with the files in question)
---- Assorted other files and folders that don't matter for what I'm trying to do.

I need to send the files in the Mixdown folder to a music editor through my Dropbox. Ideally what I'd like to do is to have Hazel watch the Main Project Folder, and watch for files going in the Mixdown folders of each individual cue, sort them into a subfolder with the Individual Cue Name as the title, and move that folder to my Dropbox. The reason I need it to watch the Main Project folder is that there's going to be a bunch (65+) individual cue folders created as I go, so it's not very beneficial to have to create a new watch folder for each.

Anyone have any clever ideas on how I can make this work?

Thanks.
JZilla
 
Posts: 8
Joined: Sat Apr 22, 2023 8:15 pm

Search for subfolders in the manual. There's a chapter dedicated to having Hazel go into subfolders.

As for moving them into a subfolder, it's better if you move the file t the destination (Dropbox), then sort it into a subfolder there. Is the cue name available in the metadata of the individual files?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hey, thanks for the reply. I've got a handle on the going into subfolders aspect, it's the sorting thing that's the tricky part. I've just taken a look at the metadata, and it doesn't look like there's a filename in there. A couple of things that might be useful though, the first being that each exported file has the same start time, which is embedded in the metadata. If Hazel can read that, they could at least be recognized as being from the same cue.

Also, each exported file will have the same prefix, which in my case is a two-character project code, a four-character cue number, and the cue title followed by a space and a dash. For example: XX 1m01 Cue Name - 01 Strings, XX 1m01 Cue Name - 02 Woodwinds, etc. If there was a way to pull the first seven characters into a variable that could rename the folder, that'd give me the project name and cue number. Or even better, if Hazel could grab everything before the dash, then I'd get the filename, as well as any version number of the cue. That might be a little ambitious, but hey, gotta aim for the moon, right?
JZilla
 
Posts: 8
Joined: Sat Apr 22, 2023 8:15 pm

Look up match patterns in the manual. You can use custom text attributes to save off parts of the name.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for the suggestion. Is it possible to use Match to detect if the start of a name matches the criteria? I'm trying to get it going with the Custom Text token, but because the cue name is different for each one and the titles have a varying number of words, it's getting stuck. They all start the same way with XX XmXX, but the cue name seems to be the issue, and I can only get it to work if I use the right number of words.

Feels like it's getting closer to possible though, so thanks for your help!
JZilla
 
Posts: 8
Joined: Sat Apr 22, 2023 8:15 pm

Can you post some example file names?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sure. The list of files for one cue would be XX 1m01 Main Title - 01 Strings.wav, XX 1m01 Main Title - 02 Woodwinds.wav, XX 1m01 Main Title - 03 Brass.wav, etc., with XX being a 2-3 letter code for the movie. Another one might be XX 1m02 Meeting Our Main Character - 01 Strings.wav, XX 1m02 Meeting Our Main Character - 02 Woodwinds.wav, and on from there.
JZilla
 
Posts: 8
Joined: Sat Apr 22, 2023 8:15 pm

So you want "Main Title" and "Meeting Our Main Character" from those files? Do they always start with XX and another "word"? If so, you can specify patterns to match those and then use "anything" to match up to the dash (-). This assumes the cue never contains dashes itself.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Actually, I want to label the folders XX 1m01 Main Title, XX 1m02 Meeting Our Main Character, etc., just removing everything after that. I was using "anything" and still couldn't figure out how to get it to recognize everything after the dash. Then I tried adding a second token, so the rule looked like this:

If all the following conditions are met
Name matches: (Name Pattern) (Stems Pattern) - both of these are custom text tokens
(Name Pattern) is (letter)"space"(letters & digits)"space"(anything) - this'll get me the cue code and title
(Stems Pattern) is (anything) - this will deal with the " - " and the stem name.
Name starts with: "XX" - to weed out any of the other audio files that don't use my naming convention
Kind is: Music - to make sure it's not grabbing project files or backup files

Do the following to the matched file or folder
Copy to folder - Stems - the destination folder
Sort into subfolder with pattern - (Name Pattern)

I ran into a hiccup here, it was copying everything over, but the sorting wasn't working correctly, each file was getting its own folder, and the duplicates had something like Unicode Conflict Error in the name (I can't remember the exact thing it said). I suspected it had something to do with the files coming in sequentially over however long it'd take to copy them. So instead of sorting it into subfolders at this stage, I added my Stems folder as a second watch folder with the following rule:

If all the following conditions are met
Name matches: (Name Pattern) (Stems Pattern)
Kind is: Music - to make sure it's not grabbing project files or backup files
Date added is not in the last 1 minute - to account for the copy time

Do the following to the matched file or folder
Sort into subfolder with pattern - (Name Pattern)

And everything's now working as I need. There might be something I could do to not need the second watch folder, but it's set up now and is working fine, so I'm happy. Thanks for all the help on this, I'd worked with pattern matching a little bit before, but the "anything" one was new to me, and I would've been floundering for a while trying to figure it out.

Thanks!
JZilla
 
Posts: 8
Joined: Sat Apr 22, 2023 8:15 pm


Return to Support