Note: The issue with delay
was fixed in OS X 10.11 El Capitan.
Ever since I upgraded to Yosemite, Applescripts that use delays have stopped working. How can I fix this?
Here's the world's simplest Applescript, for the sake of an easy example:
set volume output volume 0
delay 5
set volume output volume 20
delay 5
set volume output volume 0
delay 5
set volume output volume 20
delay 5
set volume output volume 0
delay 5
set volume output volume 20
delay 5
set volume output volume 0
That should take 30 seconds to complete. If I run it in Script Editor (formerly Applescript Editor) it takes 30 seconds to complete. But if I save this script as an app, when I launch the app, the delays are ignored and the app takes a fraction of a second to complete.
How can I force Applescript to delay for a specified amount of time before moving on to the next step? Is this a Yosemite glitch? Is there a reliable workaround?