Merge Subfolders to Parent Folders / Rename

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

Moderator: Mr_Noodle

Merge Subfolders to Parent Folders / Rename Tue Aug 16, 2016 1:53 pm • by haupti
Hello Mr_Noodle,

I have following problem and hop You can help me. :-)

The situation I have, on example "Renault":

Cars (Monitored folder)
-- Renault (Parent folder)
---- Clio
-------- clio.jpg
-------- clio34.jpg
-------- clio 3.jpg
---- Megane
-------- megane.jpg
-------- megane 2.jpg
-------- megane_3.jpg
---- Laguna
-------- laguna8.jpg
-------- 3.0 V6 (Folder)
------------ laguna34.jpg
-------- 2.0 R4 (Folder)
------------ laguna3.jpg
------------ laguna23.jpg

The final situation should be:

Cars (Monitored folder)
-- Renault (Parent folder)
---- Renault_clio.jpg
---- Renault_clio34.jpg
---- Renault_clio 3.jpg
---- Renault_megane.jpg
---- Renault_megane 2.jpg
---- Renault_megane_3.jpg
---- Renault_laguna8.jpg
---- Renault_laguna34.jpg
---- Renault_laguna3.jpg
---- Renault_laguna23.jpg

I would like merge each subfolder to each Parent folder (in the example "Renault") and than add filename with the new folder name (in the example also "Renault").

In these forum I have looked to an solution, but I have't found it.

Greetings
Bernd
haupti
 
Posts: 6
Joined: Tue Aug 16, 2016 1:30 pm

First see the sticky article about telling Hazel to go into subfolders.

From there, you'll need a separate rule to move the files. You can use "enclosing folder" as a destination in the move action to do that part. To rename using the parent folder's name, you can do something like:
Code: Select all
    If (all) are met
        If (all) are met for the enclosing folder
            Name matches (•parent name)
    Rename (•parent name)_(name)

To get the nested condition, hold down option while clicking the + button to create a new condition. For the rest, look up "match patterns" in the help. That should get you started.
Mr_Noodle
Site Admin
 
Posts: 11879
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Merge Subfolders to Parent Folders / Rename Wed Aug 17, 2016 12:39 pm • by haupti
Hello Mr. Noodle,

thank You for the quick answer, but I'm afraid to be to stupid for this. :-(
Renaming the files is in an other rule possible. But the 1st step is my problem again:
All files move in each parent Folder:

1st rule:
Image

2nd rule:
Image
haupti
 
Posts: 6
Joined: Tue Aug 16, 2016 1:30 pm

For the second rule, try and input it as I showed (though you should add the "Kind is Image" condition to the top level as well).
Mr_Noodle
Site Admin
 
Posts: 11879
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron