Originally Posted by gregypoo
Hi,
I've build a applescript that execute a workflow every time I add or remove a file in a folder.
Unfortunately it doesn't work when a file within the folder get's modify. Does someone know how an apple script attached to a folder would detect a file modification?
Judging from the lack of response to this question I am going to say that everybody else ran into the same dead ends that I did in looking for an easy solution.
The only thing I can come up with is to keep a list of the file names and last modified dates of every file in your folder. Put this in an "on idle" handler. The time between activations will depend on how fast you need the system to react once a file has been changed. Is 30 seconds fast enough? Is one hour fast enough?
The feasibility of this will also depend on how many items you have in this folder. 50 or less -- a piece of cake. 5000 or more -- well that might be a little slow.
I did something like this about 6 years ago. I wanted cetain people to be notified when a new file appeared on our ftp server. I don't think folder actions were around at that time. I can't find the code, but if you need a start on the concept I have listed here just let me know and I'll take a stab at it.
-numero