Search code examples
applescriptautomator

How to pause execution of applescript for some time?


I have a small applescript in Automator:

do shell script "osascript ~/Focus-On.scpt"
delay 60
do shell script "osascript ~/Focus-Off.scpt"

Basically, i want to execute the first shell script, then, after a minute, the second one.

But Automator executes both without any delay. How to fix it?


Solution

  • The easiest way I found: just to pass the job to a shell:

    do shell script "osascript ~/Focus-On.scpt; sleep 10; osascript ~/Focus-Off.scpt"