Re: Stay-Open Script Apps vs Cron
Re: Stay-Open Script Apps vs Cron
- Subject: Re: Stay-Open Script Apps vs Cron
- From: Axel Luttgens <email@hidden>
- Date: Thu, 05 Jun 2014 13:18:30 +0200
Le 5 juin 2014 à 11:50, S. J. Cunningham a écrit :
> [...]
> I would prefer the daemon to run asynchronously, ie two hours from the last activity rather than simply every two hours. I thought I could do this by changing the idle time in an idle handler every time an email arrives but it looks like that is not possible.
> [...]
Hello Steve,
Perhaps could you reverse the logics?
The easiest, and probably the safest, would be to have the idle handler run, say, every 5 minutes.
For example (with probably lots of details left as pseudo-code):
on idle
set last_activity to <fetch the last activity time from the last activity file as an AppleScript date>
if current date - last_activity >= 2*hours then
<sound a local alarm>
end if
return 5*minutes
end idle
HTH,
Axel
_______________________________________________
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