Page 1 of 1

Moving FIles from Subfolder

PostPosted: Wed Oct 01, 2014 5:21 pm
by manonlaco
Greetings! I'm not sure if the follow situation is viable through Hazel:

I'd like Hazel to monitor a specific folder; when Hazel see's the name of a sub-folder contained within this folder matching a specific name, I would like Hazel to move all of the files contained within that sub-folder to another folder.

For example, the top level folder would be "pictures". Contained within the folder "Pictures" are various sub-folders named by creation date (20141001, 20141002, etc). Contained within each sub-folder is a sub-sub-folder named "email".

If any of the sub-sub-folders named "email" contained within any of the sub-folders are renamed to some preset name, for example "leroyemail" I would like Hazel to move all of the files contained within "leroyemail" to another preset folder.

Is Hazel capable of this type of functionality, or am I barking up the wrong tree.

Thanks in advance for your assistance and insight.

Re: Moving FIles from Subfolder

PostPosted: Thu Oct 02, 2014 10:28 am
by digitalworkshed
I am also wondering about the same exact thing! Anybody out there who can give their opinion about this?

Re: Moving FIles from Subfolder

PostPosted: Thu Oct 02, 2014 11:34 am
by Mr_Noodle
First off, read the sticky article at the top of this forum on going into subfolders.

Once you have that in place, you'll need to create a rule to move the files. One way to do this is:

Code: Select all
If (all) are met
    If (all) are met for the (enclosing folder)
        Name matches leroyemail
    <whatever other conditions>
Do
    Move to <wherever>

To get the nested condition, hold down the option key while clicking the + button to create a new condition. You can then set the target to the enclosing folder. What that rule basically does is match files whose enclosing folder has the name "leroyemail" which is what I believe you want.

Re: Moving FIles from Subfolder

PostPosted: Sun Oct 05, 2014 12:54 pm
by manonlaco
This is exactly what I was looking for. Thank you.

Now that the files have been moved to the correct location, how would I automate the moving of "leroyemail" to the trash?

Re: Moving FIles from Subfolder

PostPosted: Mon Oct 06, 2014 11:04 am
by Mr_Noodle
I'm assuming the folder is empty at this point? If so, just create another rule to match that folder when it is empty and move it to the trash.