• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: delay doesn't work when applet is not frontmost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Thu, 05 Mar 2015 11:23:08 +1100

On 5 Mar 2015, at 11:06 am, Stockly, Ed <email@hidden> wrote:
>
> If I save this script as an applet, the delay 20 command seems to be
> ignored as soon as the script is no longer frontmost.
>
> If you remove the finder activate command, the delay works, but if you
> bring another app to the front, it stops delaying and goes on with the
> script.
>
> Can anyone repeat see this? Is it new?

It's a Yosemite thing, and it's worse than that -- just moving the mouse is enough to end all delays. You don't generally notice it in editors because they usually run scripts on a background thread, and the problem only happens on the main thread. It was discussed here some time back.

A workaround is to add this to your scripts:

on delay delayTime
	set theRepeat to delayTime * 10 div 1
	repeat theRepeat times
		do shell script "sleep 0.1"
	end repeat
end delay


--
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


  • Follow-Ups:
    • Re: delay doesn't work when applet is not frontmost
      • From: "Stockly, Ed" <email@hidden>
    • Re: delay doesn't work when applet is not frontmost
      • From: Alex Zavatone <email@hidden>
    • Re: delay doesn't work when applet is not frontmost--
      • From: "email@hidden" <email@hidden>
References: 
 >delay doesn't work when applet is not frontmost (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Recurring Reminders/Calendar Events?
  • Next by Date: Re: Recurring Reminders/Calendar Events?
  • Previous by thread: delay doesn't work when applet is not frontmost
  • Next by thread: Re: delay doesn't work when applet is not frontmost--
  • Index(es):
    • Date
    • Thread