Page 1 of 1

Possible to have a generic rule for arbitrary folders?

PostPosted: Thu Feb 12, 2015 9:49 am
by bennetimo
Hi,

I've been playing around with Hazel a little bit and setting up some rules on folders to organise files into subfolders based on dates. Everything is working great but I am having to add each folder, and then copy the rules over. Just wondering if it is possible to do or achieve something like this with hazel:

1. Create a generic rule not tied to any specific folder that sorts file into sub folders by date (for example)
2. On any folder in finder, right click and 'run hazel rule on this folder'
3. Files all sorted

I have a lot of old documents and things that I want to organise, but it's a bit of a tangent use case to what Hazel is designed for I guess. i.e. I don't need hazel to watch these folders as they are old archives and won't be updated, I just want to do a one time sort of some of them using Hazel as it is so powerful in that respect.

I'm looking for a kind of generic rule that I can apply to any folder on demand, without actually adding it as a watch folder in Hazel.

Is anything like this possible? :) I had a search through the forums/faq but couldn't find anything

Thanks

Re: Possible to have a generic rule for arbitrary folders?

PostPosted: Thu Feb 12, 2015 12:39 pm
by Mr_Noodle
Something like this is on the feature list but doesn't exist now. Can you give me a concrete example of how you would use this? While I appreciate feature requests, they are much more likely to be implement when I have real use cases for it.

Re: Possible to have a generic rule for arbitrary folders?

PostPosted: Thu Feb 12, 2015 1:12 pm
by bennetimo
Ok thanks for your reply, I didn't think it was possible right now but worth checking :)

As for a couple of use cases, sure.

Use case 1: Organise specific, archived folders into dated sub folders
I have old folders of bills/letters/receipts for old projects that have no new files coming in. I want to do one time cleanup, inside each of the project folders, to organise all the files into nested subfolders by date. For some folders just by year, some by year-month etc.

Ideally I could create two date rules for each of these cases, then on any folder in Finder right-click->apply hazel rule->choose date rule. I don't need Hazel to watch the folders, just clean them up once.

Use case 2: Organise specific, archived folders by document type
Similar to 1), I would like to be able to sort some folders, one-time, into nested folders for document type. So after navigating to a 'messy' folder full of different documents, I can do a one time right-click->apply hazel rule->organise by kind

I guess Hazel focusses on choosing a folder to watch, and then applying rules on that folder. I kind of want to do the inverse. Setup a set of generic rules like:

-Organise by date
-Organise by kind
-Archive if old
-(basically all the kind of hazel rules that are useful now)

But not attach them to any folder. Then on demand when I need it, apply that rule to any specific folder and let Hazel do it's magic.

I'm using it to do both the use cases above now with a bit of a workaround which is:
1. Create a dummy folder
2. Create all the 'generic' rules I want on that dummy folder
3. Drag folder I want to sort, one-time, into hazel
4. Drag rule from dummy folder onto that folder (to copy the rule)
5. Run rules manually
6. Remove the now sorted folder, I don't need hazel to watch it anymore

Hope this helps, and thanks for an awesome tool :)

Re: Possible to have a generic rule for arbitrary folders?

PostPosted: Mon May 23, 2016 4:36 pm
by gcoghill
I too have often wished for a way to run rule sets on specific folders via right-click.

Re: Possible to have a generic rule for arbitrary folders?

PostPosted: Tue May 24, 2016 10:32 am
by Mr_Noodle
It was something considered for 4.0. The issue is that there kinda is, kinda isn't an API to do this on OS X. It can be done via a Finder Sync Extension, but the docs state that it should not be used for the types of things I would want to use it for. I could do it anyways but it's unclear what kind of things will go wrong and how Apple would react to it.

So, for now it is shelved until Apple either gives the go ahead or clarifies things a bit more.