You are not logged in.
Folder actions have been a very useful tool in many scripters' toolbox, but they do have a few drawbacks. Not the least of which is some tendency for the script to act upon files which haven't yet finished copying to the hot folder. If you have run into this or some other problem inherent with folder actions, there is another way to achieve the hot folder concept.
This time out, I'm going to show you how to build a stay-open script with an on-idle handler. A script like this acts much like a full blown application in that it stays running and includes the ability to run commands on a regular interval. As you might imagine, this is extremely useful in many scenarios, not just watched folders. For example, wouldn't it be cool to create your own System Event-like actions? With a stay-open script, you can have the script watch for the presence of your removable hard drive and act upon it. Sound exciting? It is. Let's get started.
In the first screenshot, you'll see that I've added what's called an on-idle handler. This construct is unique in that it actually has two parts. The first being the on/end on statements.
T.J.
tj@tjmahaffey.com
Offline