Update folder last modified date based on subfolder changing

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

Moderator: Mr_Noodle

Hi - one of the Finder limitations that bugs me is that folders only update their last modified date based on files in it changing, not files in subfolders changing. I'd like to setup Hazel rules to fix that.

Structure:

Documents
Folder
Subfolder
File

When I modify File, I want the last modified date of Folder to be updated.

I added Documents to Hazel, then created two rules:

1. Rule to go into subfolders: If Kind is Folder then run rules on folder contents.

2. Rule to update date of parent folder (since file changes automatically update their folder date, I focus on folders): If Kind is Folder and date last modified is today, then run shell script, where script is:

dir=`dirname $1`
touch -m $dir

I figured that if I run this every day, then it should work. If I skip a day (see: weekend), then not so much, but at least it would be somewhere near the top of the Documents folder.

Except, it's not working. Any suggestions on what I'm doing wrong?
nunuvyurbiz
 
Posts: 2
Joined: Wed Feb 03, 2016 8:49 pm

How is it not working? Are any modified dates being updated? Just ones for certain folders? Try going through the troubleshooting guide as that will also help isolate the problem.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron