Move Folder based on filetypes within folder

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

Moderator: Mr_Noodle

Move Folder based on filetypes within folder Sun Sep 23, 2012 7:54 am • by sjo03
Trying to get my head around hazel
Based on a folder structure like this:
filea.pdf
fileb.jpg
folderx which contains files filex.pdf and filey.pdf
foldery which contains filez.jpg

Would like to move all pdf files to a seperate folder pdf, and all jpg files to a seperate folder jpg : that is easy
However : I would also like to move folders to a seperate folder based on what is in the folder : here folderx would move to folder pdf because it contains pdf files, foldery similar to folder jpg because it contains jpg.

Basically looking for a rule :
Kind is Folder
Folder contains files ending in PDF
Then
Move Folder to xxx

Any help would be appreciated
sjo03
 
Posts: 1
Joined: Sun Sep 23, 2012 7:47 am

Code: Select all
If all are met for any sub-file
    Kind is PDF
Move to <some folder>


The above makes some assumptions on how you want to do things but I think that should do it for you. Keep in mind this will move folders that have a single PDF. You will need to modify it if the folder has to ONLY contain PDFs. I'm not sure how you want it to behave if a folder has a PDF and jpg; in such a case you'll have to muck with the conditions and/or the rule ordering. If this doesn't fit the bill then you'll need to provide more specific details about what you want in this case.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron