Re: delay doesn't work when applet is not frontmost
Re: delay doesn't work when applet is not frontmost
- Subject: Re: delay doesn't work when applet is not frontmost
- From: Shane Stanley <email@hidden>
- Date: Fri, 06 Mar 2015 09:41:04 +1100
On 6 Mar 2015, at 4:43 am, Stockly, Ed <email@hidden> wrote:
>
> I'm wondering why not just
>
> on delay delayTime
>
> set sleepScript to "sleep " & delayTime as text
> do shell script sleepScript
> end delay
>
> Seems to work, does sleep interfere with other processes or something?
When you use sleep, your script is on hold until it returns. You will notice that if you you move the mouse much, you will see the spinning cursor. And it won't respond to command-. immediately, if at all. By breaking it into smaller segments, things stay responsive. The delay command, by contrast, does stuff to keep things responsive automatically.
It's often not a big deal -- although it certainly matters more in Xcode projects. But IMO it's preferable not to have the spinning cursor appear. It's not as if it's any great impost.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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