Page 1 of 1

Can Hazel detect when a file is renamed?

PostPosted: 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!

Re: Can Hazel detect when a file is renamed?

PostPosted: Fri Jul 05, 2013 3:23 pm
by Mr_Noodle
There is the Sync action which does this in one fell swoop if applied to the folder.

Re: Can Hazel detect when a file is renamed?

PostPosted: Sat Jul 06, 2013 4:24 am
by commissarmo
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)?

Re: Can Hazel detect when a file is renamed?

PostPosted: Sat Jul 06, 2013 4:32 am
by commissarmo
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?

Re: Can Hazel detect when a file is renamed?

PostPosted: Mon Jul 08, 2013 8:44 am
by commissarmo
Anyone?

Re: Can Hazel detect when a file is renamed?

PostPosted: 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.

Re: Can Hazel detect when a file is renamed?

PostPosted: Mon Jul 08, 2013 2:06 pm
by commissarmo
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?

Re: Can Hazel detect when a file is renamed?

PostPosted: 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.