Move folder based on content (creation date)

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

Moderator: Mr_Noodle

Move folder based on content (creation date) Mon Feb 06, 2012 2:10 pm • by goose
Hi all!

I have a root folder which has twelve subfolders (named 2012-01 to 2012-12). When dropping a new folder into the root folder, I want Hazel to check the new folder's content, find out when that was created and based on that move the containing folder to one of the twelve subfolders.

So for example I drop a folder named Foo into the root folder. The files in Foo where created on 2012-01-01. I then want Hazel to move the Foo folder to 2012-01.

At the moment I have Hazel setup to do the following:
- Monitor the main folder > See if the criteria is met (Kind is Folder) > Sort file into subfolder with pattern...
For the pattern I select other. From the pop-up I select the one I think is appropriate and translates to: creation date content (My OS is in Dutch so it's a rough translation).

When running the rule nothing happens unfortunately. From the log I get the following message:
Code: Select all
Caught exception in rule evaluation of file Foo: Could not retrieve metadata for file: /Users/goose/root/Foo


Am I missing something, or is there maybe a better way to achieve this?
Many thanks in advance for any help! :D
goose
 
Posts: 3
Joined: Mon Feb 06, 2012 1:32 pm

It appears you don't have Spotlight indexed for that folder. Check your Spotlight privacy settings to make sure that folder isn't in there. Also, if you are comfortable using the commandline, you can use the mdutil command to check if indexing is turned on.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for your response Mr_Noodle!

I turned Spotlight Indexing on for that root folder and it now does move the folders, but not based on the creation date of its contents but based on creation date of the folder itself.
I've tried different patterns from the pop-up, but all act in the same way.

Any ideas?
goose
 
Posts: 3
Joined: Mon Feb 06, 2012 1:32 pm

In the current version, you can't do this without a script. Either that, or some more complicated scheme where Hazel goes into subfolders and colors the parent folder based on the file's creation date. But even then, which file's creation date do you use? I think you are assuming all the files have the same creation date in your case but you still need to think about how to deal with the case when they aren't.

In 3.0 (in beta now), you can add conditions based on the folder's contents though again, you'd have to specify whether you want the condition to match if any of the subfiles match or all of them.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:But even then, which file's creation date do you use? I think you are assuming all the files have the same creation date in your case but you still need to think about how to deal with the case when they aren't.

That's one thing I looked into for before creating certain rules. Luckily all files have the same creation date, else I wouldn't even go that route. For now I'll see if I can work around it.

Great to hear 3.0 will accomodate such features.
Thanks for your time and effort explaining this more!
goose
 
Posts: 3
Joined: Mon Feb 06, 2012 1:32 pm


Return to Support