Can Hazel detect when a file is renamed?

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Can Hazel detect when a file is renamed? Fri Jul 05, 2013 6:11 am • by commissarmo
I am using Hazel to one-way copy files to DevonThink Pro Office, the personal database software.

I set it up to monitor a documents folder, for example, and send these to another folder (the unique DevonThink inbox folder, which accepts files, but immediately moves them so it's always empty, thus sync programs cannot sync to it properly since they always think the folder is empty).

I did this with "Date last modified IS AFTER date last matched"... and it copies the files, which I maintain in a FLAT configuration, because I couldn't figure out how to get Hazel to properly copy subfolders.

1. BUT, I have discovered that this leaves 2 gaps in the copy process that I want to try to fix. The most annoying is that when a file is RENAMED by the user, Hazel/MacOS doesn't consider this a 'modification' to the file, and doesn't update that. So when I rename files, the renamed file is NOT copied with the new name.

Is there a rule I can use that will cover files that have been renamed? (Obviously in Sync programs, this is fine, since they just scan the folder live and will move anything that has been changed, but as I mentioned, I cannot use sync programs for this particular edge case)

2. I have also realized that these rules will NOT move the initial contents of the folder to my target folder because they haven't been 'modified', meaning I have to manually 'seed' the initial files into the target folder, and THEREAFTER, all files added/saved to this folder will be transferred by Hazel because they are 'modified'.

Is there a rule to force it to copy the files initially that haven't been modified? i.e. just copy the contents of the folder to the target?

Thanks in advance!
commissarmo
 
Posts: 8
Joined: Fri Jul 05, 2013 6:05 am

There is the Sync action which does this in one fell swoop if applied to the folder.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ok... I'm not sure how to go about setting that up though - if I just use 'date last modified is after date last matched' I'm still getting the problem above - how do I select simply "ALL FOLDER CONTENTS"?

I'm also not sure how will Sync behave when the target folder does NOT maintain actual copies of the data (the target folder is ALWAYS empty)?
commissarmo
 
Posts: 8
Joined: Fri Jul 05, 2013 6:05 am

Ah! Ok for some reason I had never seen "Any File" before - that takes care of that.

But I'm still confused as to how the Sync command is working exactly:

1. The target folder is always empty - will the produce issues? Does 'sync' ever scan the target folder for a comparison of what to 'sync'? If it does, I'm assuming there will be problems?

2. Even though I've now set it up to "sync" it's still NOT catching (and NOT synchronizing) re-named files - which of course, was my primary goal in the first place?
commissarmo
 
Posts: 8
Joined: Fri Jul 05, 2013 6:05 am

Anyone?
commissarmo
 
Posts: 8
Joined: Fri Jul 05, 2013 6:05 am

Re: Can Hazel detect when a file is renamed? Mon Jul 08, 2013 12:33 pm • by Mr_Noodle
Search the forums on sync (with a particular emphasis on posts from me). In short, you should have Hazel monitor the folder containing the folder you want to sync, then have that rule match the folder you want to sync.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Looking at the forums, it seems that you have suggested in the past that if the 'sync' action is set up one folder level (for the containing folder of the files, rather than inside the folder for the files THEMSELVES, that file-renaming will be detected.

I'm a little confused though about how to do this since I am syncing my Documents Folder.

While I'm not really familiar with Mac yet (first 2 weeks with MacOSX), I'm not sure what the super-containing folder for the Documents folder is.

But even so, I do NOT want ALL the contents of that super folder to be sync-ed - only the Documents folder.

Am I understanding this correctly?
commissarmo
 
Posts: 8
Joined: Fri Jul 05, 2013 6:05 am

Re: Can Hazel detect when a file is renamed? Tue Jul 09, 2013 12:38 pm • by Mr_Noodle
In that case, you'd want to set it up to monitor your home folder. That said, monitoring your home folder can be a bit dicey since it exposes all your files.

Also, going back, maybe you should post your rules. I suspect there's something else more fundamentally wrong as a renamed file should work if you set your rules up correctly.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion