Renaming and moving files in multiple folders into 1 folder

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

Moderator: Mr_Noodle

Looking for how to set up Hazel to solve this problem:

When I use a certain recording app, it throws the files up on iCloud in a structure that is really cumbersome. All files from a day are put into a folder with the day's date, and the files inside are named with the time they were recorded. What I want to do is rename the files using the date of the folder they are in followed by the time, and then put all the files in one folder.

So files look like this at the moment:

2020-09-23 (folder name)
14-35-39.m4a
20-52-38.m4a

2020-09-25 (folder name)
14-30-05.m4a
17-42-13.m4a
17-59-18.m4a

etc.

What I want is one folder called Audio Files and the files to be named like this:
Audio Files (folder name)
2020-09-23_14-35-39.m4a
2020-09-23_20-52-38.m4a
2020-09-25_14-30-05.m4a
2020-09-25_17-42-13.m4a
2020-09-25_17-59-18.m4a

etc.

I would like this to be an automatic process watching the parent iCloud folder, though I dont know if icloud folders can be watched. If not then when I manually move them from iCloud to a local folder, that Hazel would automatically rename and move them locally and then I can reupload them to iCloud.

Thanks in advance!
romebot
 
Posts: 6
Joined: Fri Feb 19, 2021 2:03 pm

You can do this with a nested condition in combination with a match pattern (look those up in the manual if you don't know what those are).

You're conditions would look something like:
Code: Select all
If (all) are met
    If (all) are met for the enclosing folder
        Name matches (• parent folder name)

where (•parent folder name) is a custom attribute you create which is set to match "anything". That will grab the name of the parent folder which will then be usable in your Rename action.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

ok, thx! I'll work on it this week and see how it goes.
romebot
 
Posts: 6
Joined: Fri Feb 19, 2021 2:03 pm


Return to Support

cron