Sort files after top folder.

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

Moderator: Mr_Noodle

Sort files after top folder. Tue Nov 29, 2016 6:43 pm • by NewJonas
Hello, I need some help.

I can’t find any guide on the forum, at least not something I understand.

My problem is, I want to move all files inside a folder into another folder named after something from the top folders name.


If I for instance have a folder called, “Verylongname10” and it has some files inside it.

Then I want hazel to move all the files inside it out, and sort them into a subfolder with the pattern “name100” from the top folder “Verylongname10”.


I already know how to move files from inside a folder out with the pattern of something of the file name. But I don’t know how to name it after the folder it came from.


This is what I’ve been able to do so far:

http://snpy.in/hEsaB2
http://snpy.in/r5lVFI
NewJonas
 
Posts: 1
Joined: Fri Nov 11, 2016 4:24 pm

Re: Sort files after top folder. Wed Nov 30, 2016 12:45 pm • by Mr_Noodle
To do this, you can try a nested condition: https://www.noodlesoft.com/kb/how-to-cr ... onditions/

Code: Select all
If (all) match
   If (all) match for (the enclosing folder)
       Name matches (• parent name)
...


where (•parent name) matches anything. What that does is match the parent name and stores it into that custom attribute which you can then use later. Give that a shot.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support