Copy on change

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

Moderators: Mr_Noodle, Moderators

Copy on change Sun Feb 11, 2007 7:28 pm • by jhorman
I was hoping it would be easy (well, maybe it is and I just didn't figure it out) to copy a file whenever a change is saved to it. There are a few ways to do it. I tried creating a rule that applies whenever "date modified is greater than date opened", it seems those values are the same for the most part so that didn't work. I then thought I could do something like "datemodified greater than 5 minutes ago" or something. Even "datemodified = today" would be nice. I guess the problem with those rules would be that they would keep applying until the condition fails, which could be 5 minutes for example.

The best option would be "on modification". That would be awesome.

Any help is appreciated.

Thanks,
-jason
jhorman
 
Posts: 2
Joined: Sun Feb 11, 2007 7:22 pm

Re: Copy on change Sun Feb 11, 2007 7:36 pm • by jhorman
Sorry, just noticed that you do have relative dates, so that may work. If I say "datemodified greater than 2 minutes" or something, will it just keep running that rule, recopying the file until 2 minutes is up?

jhorman wrote:I was hoping it would be easy (well, maybe it is and I just didn't figure it out) to copy a file whenever a change is saved to it. There are a few ways to do it. I tried creating a rule that applies whenever "date modified is greater than date opened", it seems those values are the same for the most part so that didn't work. I then thought I could do something like "datemodified greater than 5 minutes ago" or something. Even "datemodified = today" would be nice. I guess the problem with those rules would be that they would keep applying until the condition fails, which could be 5 minutes for example.

The best option would be "on modification". That would be awesome.

Any help is appreciated.

Thanks,
-jason
jhorman
 
Posts: 2
Joined: Sun Feb 11, 2007 7:22 pm

Mon Feb 12, 2007 12:40 pm • by Mr_Noodle
If a file matches a rule, it remembers that it matched it so that if it continues to match the same rule, it won't re-run the actions. Note though that it's possible for it to match some other rule (or no rule) which "clears" its memory of the other one and then may end up matching the original rule again.

I've thought about adding a "Date Last Checked" which would be the time when Hazel last looked at the file. In theory, then, you would be able to do "Date Last Modified is after Date Last Checked". There are some complications with this in relation to the mechanism described above to work out though.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion