Re: Watch folder activation
Re: Watch folder activation
- Subject: Re: Watch folder activation
- From: Stan Cleveland <email@hidden>
- Date: Sun, 9 Jul 2017 10:06:46 -0700
> On Jul 9, 2017, at 06:17 AM, Jim Brandt <email@hidden> wrote:
>
> I have a Mac Mini running El Capitan which has a script attached to a watch
> folder.
> <snip>
> Only re-booting the machine makes the watch folder work. After a period of
> inactivity, the watch folder quits working again.
> <snip
> Is this a bug in the OS or is there something else I should be doing to make
> the watch folder stay active?
Hi Jim,
I've never found folder-attached scripts to be reliable over the long haul. I
instead use an idle loop within a stay-open script. I've had such scripts run
24/7 for weeks, only requiring a reboot when the computer starts to bog down
from memory issues.
In your case, at the top of each idle loop get a directory listing of the
watched folder to see if any plist files are present. If so, process them.
Otherwise, go idle for the desired amount of time (from 1 second to hours),
then the loop will restart and check the folder again.
Regards,
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden