Page 1 of 1

Hazel moving entire folder instead of folder contents

PostPosted: Thu Mar 31, 2016 12:44 pm
by parasight
Hey, I've followed the "How to get Hazel to go into subfolders" thread, but I just can't get it working properly.

Here's the basic example provided in that thread:

Image

And here are the rules I've set up:

Image

The rules are basically identical, the only difference being that I am additionally checking the folder name.

Hazel, however, moved the entire folder instead of its contents. I don't understand why this is not working.

Re: Hazel moving entire folder instead of folder contents

PostPosted: Fri Apr 01, 2016 9:50 am
by Mr_Noodle
It's moving the folder because the conditions match a folder (Kind is folder). Read the sticky article again as it warns about combining logic for different things (folders and the files within) into a single rule. Try separating it into two rules. One that matches folders (and goes into them) and one that matches the files within that you want to move.

Re: Hazel moving entire folder instead of folder contents

PostPosted: Mon Apr 18, 2016 6:01 am
by parasight
Thanks for your reply. I've re-read the thread a number of times and I think I should probably present some more context. It seems to me that it's impossible to apply the suggestions there.

I'm trying to auto-sort a stock photo archive from the weekly unsplash.com newsletter into my media manager (Ember, which monitors an auto-import folder). I want to be able to start the download and have Hazel do the rest for me. So this would be the order:

  1. Manually download .zip file
  2. Hazel detects .zip file
  3. Hazel unzips .zip file
  4. Hazel moves contents of unzipped folder (.JPG-files) to media folder
  5. Ember detects images and auto-imports into library.

The unarchive function always creates a folder with the contents of the zip file. Ember cannot descend into subfolders. I need to move the JPG files themselves, and not the containing folder, into Ember's auto-import folder. I thought Hazel might help me do that, but everything I've tried so far has failed.

I don't know how to split that up into 2 rules, as you have suggested. Here's why:

a) I can't run a folder-based rule on a non-existent folder

The folder is created when the .zip file is unarchived. I've tried by renaming the .zip-file before unarchiving so that the resulting folder always has the same name (so that Hazel can monitor it, in this case unsplash-archive), but Hazel blocks me from doing that:

Image

b) I can't keep an empty folder around because the Unarchiver can't overwrite it.

My second idea was to have an empty folder that Hazel can monitor, but the Unarchiver just adds a new folder with a trailing -1:

Image

So, it seems like my hands are tied, unless I'm missing something important?

Re: Hazel moving entire folder instead of folder contents

PostPosted: Mon Apr 18, 2016 10:13 am
by Mr_Noodle
The point of the subfolder rule is that it goes into any folders under the monitored folder. If you look at the rule, the only condition is "Kind is folder". So, as long as that thing you want Hazel to go into is a folder, it will work. No need to add those folders to Hazel. Just monitor the folder that contains the zips and the rules will handle it from there.

Re: Hazel moving entire folder instead of folder contents

PostPosted: Tue Apr 19, 2016 4:52 am
by parasight
Sorry, I still don't get it. How do I access .jpg files within a subfolder of a monitored folder? That's all I really need to know. I've been spending hours across several days trying to set this up and I'm just not seeing it. I'd really appreciate if you had a few moments to create a screenshot of the proper setup.

Re: Hazel moving entire folder instead of folder contents

PostPosted: Tue Apr 19, 2016 9:28 am
by Mr_Noodle
There's a screenshot of one of the rules in the article. Do not modify that unless you know what you are doing. That rule matches folders. To have something process jpgs, then create ANOTHER rule to match those and deal with them.

Re: Hazel moving entire folder instead of folder contents

PostPosted: Mon May 09, 2016 6:35 am
by parasight
Alright, I got it working now, thanks. It wasn't obvious to me that the "run rules on subfolders" directive applied to all rules on a folder. I realize you mentioned it by alluding to a ruleset, but it didn't register with me because I was expecting the system to be more granular. I thought "run rules on subfolders" referred to whatever tasks follow below the directive within a single rule. I'm coming from front-end development with Gulp, where you can pipe tasks and have different tasks run in different scopes on the same folder, so I was viewing it through that mindset this entire time. Thanks for your help!

Re: Hazel moving entire folder instead of folder contents

PostPosted: Mon May 09, 2016 10:38 am
by Mr_Noodle
It's admittedly hard to grasp but it provides for the most control while also making it a bit harder for people to do something they didn't intend to whole hierarchies of files.