Would this be a good approach for a watch folder?
Posted: Sun Nov 11, 2012 6:55 am
Hi there!
I want to use a watch folder on OS X. A watch folder for me is a folder that should be constantly monitored for new files that are added to it. Every time a new file is added to this empty folder, a script should run. Fles that have been processed by the script should afterwards be moved automatically to another folder.
I'm thinking of using an endless repeat loop which constantly checks if the folder is empty or not. Would that be a good approach? Or is it overkill to have an application that is constantly running at full speed in situations where new files may be added only a few times a day? But I do want the script to run shortly after a file has been added, within a minute or so.
May be using an Automator folder action which then runs a Livecode application would also be a solution?
Just asking the experts here what they think would be the best approach before I start writing code.
Thanks!
I want to use a watch folder on OS X. A watch folder for me is a folder that should be constantly monitored for new files that are added to it. Every time a new file is added to this empty folder, a script should run. Fles that have been processed by the script should afterwards be moved automatically to another folder.
I'm thinking of using an endless repeat loop which constantly checks if the folder is empty or not. Would that be a good approach? Or is it overkill to have an application that is constantly running at full speed in situations where new files may be added only a few times a day? But I do want the script to run shortly after a file has been added, within a minute or so.
May be using an Automator folder action which then runs a Livecode application would also be a solution?
Just asking the experts here what they think would be the best approach before I start writing code.
Thanks!