How to move a folder (depending on content)

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

Moderator: Mr_Noodle

How to move a folder (depending on content) Sat Mar 24, 2012 10:59 pm • by Halvdan
I would like to check folders on my desktop and if they contain only images then move them to an 'image store folder' within the document folder. If the folder contains any other type of file however, I want it left where it is (excluded form the action).
I can't get this to work. Any suggestions?
Thanks

Just to clarify - if a folder contains images but also other files, I want the folder left where it is.

What I am struggling with is how to tell Hazel to:
- move folders that contain images
- unless they also contain other types of files
Halvdan
 
Posts: 6
Joined: Sat Mar 24, 2012 10:49 pm

It usually helps if you post the rule as you have it now. My interpretation of what you want is:

Code: Select all
  If all are true for all subfiles/folders
    Kind is Image


That moves the folder if all its subfiles are images. Now, if that folder contains other folders, I'm not sure if you want to filter them out. If you don't care about other folders then you need to modify it like so:

Code: Select all
  If all are true for all subfiles/folders
    If any are true for current file/folder
      Kind is Image
      Kind is Folder


This basically says match folders whose subfiles are all either images or folders.

As usual, pause the folder and make sure things are ok in the preview before resuming rules for the folder.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for your reply
Sorry if I was not clear - here is what I am trying to do

Code: Select all
  If all are true for all subfile / folders]
     If any are true for current file/folder
       Kind is not Text
       Kind is not PDF
       Kind is not Movie
       Kind is not Music
       Extension is not numbers
       Extension is not pages
       Kind is images

Move to designated folder


So -
if the folder does contain any of certain filetypes - leave it be
if the folder contains ONLY images, then move it

I know the logic is wrong but I have tried a multitude of ways and I cannot for the life of me get this to work.
Cheers

Mr_Noodle wrote:It usually helps if you post the rule as you have it now.

My interpretation of what you want is:

Code: Select all
  If all are true for all subfiles/folders
    Kind is Image


That moves the folder if all its subfiles are images. Now, if that folder contains other folders, I'm not sure if you want to filter them out. If you don't care about other folders then you need to modify it like so:

Code: Select all
  If all are true for all subfiles/folders
    If any are true for current file/folder
      Kind is Image
      Kind is Folder


This basically says match folders whose subfiles are all either images or folders.

As usual, pause the folder and make sure things are ok in the preview before resuming rules for the folder.
Halvdan
 
Posts: 6
Joined: Sat Mar 24, 2012 10:49 pm

Have you tried my rule? I believe it does what you want (depending on whether you include folders or not). It moves the folder is all the files inside it are images. If any of the files is something else, it won't be moved.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Yes - If I run:

Code: Select all
 If all are true for all subfiles/folders
    Kind is Image


both folders containing only images as well as folders containing images and other file types (.pages, pdf) and subfolders are selected to be moved.
Halvdan
 
Posts: 6
Joined: Sat Mar 24, 2012 10:49 pm

Maybe you should email me your full ruleset as I think there's something else interfering. Click on Contact Support in Hazel's "Info" section and attach your ruleset and I can take a better look at it.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Can I assume I'm not needed here?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Yes this was resolved by email with PK
Thanks
Halvdan
 
Posts: 6
Joined: Sat Mar 24, 2012 10:49 pm


Return to Support