Subfolders and Conditional rules

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

Moderator: Mr_Noodle

Subfolders and Conditional rules Sun Dec 07, 2008 11:55 am • by darkandlong
Hi,

Trying to set up my downloads folder to move music/pictures/fonts etc on its top level to an appropriate folder (This alone is easy)

At the same time, I want any folder containing mp3s to be moved to a music folder (Managed to get this working using the info here: http://www.noodlesoft.com/forums/viewtopic.php?f=3&t=135

My problem is doing both at the same time. It seems that there is no way to target only specific rules to subfolders. It seems that once you create a rule containing an action 'run rules on folder contents', all other rules for that folder are run on all nested folders. Obviously I could target files at a given folder depth, but there doesn't seem to be a way of setting a rule to only target files in the root folder. I initially assumed that setting a rule to only target files with a depth of 0 would target root files, but it doesn't.

So how how can I for example move all Movies to a folder called 'Movies' only if they are in the root folder, while still using 'run rules on folder contents' and other rules that target files in subfolders?

Sorry if I'm missing something obvious.

Thanks.
darkandlong
 
Posts: 5
Joined: Sun Dec 07, 2008 11:31 am

Re: Subfolders and Conditional rules Mon Dec 08, 2008 11:59 am • by darkandlong
Never mind. I think I was just being a moron.

Got it working ( Any rules to apply only to files in the root use 'subfolder depth is 0', any to apply to files in subfolders use 'subfolder depth > 0' )

Would be really nice to be able to group file types - For example if I want all font files to be moved to a certain folder, but only if on the root, I need to have a different rule for each type (ttf, otf, suit etc) as there is no way of saying:

(IF otf AND subfolder depth is 0) OR (IF ttf AND subfolder depth is 0) OR (IF suit AND subfolder depth is 0)

So would be good if you could create your own kind - I could create a kind of 'Font' that checks against any filetypes I add. Then I could do:

If kind is Font AND subfolder depth is 0 ...

Anyway. Really liking Hazel so thanks.
darkandlong
 
Posts: 5
Joined: Sun Dec 07, 2008 11:31 am

Re: Subfolders and Conditional rules Mon Dec 08, 2008 4:54 pm • by Mr_Noodle
Unfortunately, that is the way to do it now. There are several ways this can be addressed, including, as you mentioned, custom-defined Kinds.

Internally, though, the Kind stuff is based on UTIs which is a hierarchical classification system. There is a "public.font" UTI that the other font types derive from. Unfortunately, this isn't exposed in Hazel and I'd have to think of how to work that in. Another option is to add a "contains" operator to Kind so you can do something like "Kind contains font" which would match all Kinds that have the word "font" in them. A little looser but will cover a lot of cases and easier for people to understand.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron