如何在一段时间内暂停执行applescript? [英] How to pause execution of applescript for some time?

查看:62
本文介绍了如何在一段时间内暂停执行applescript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Automator中有一个小苹果脚本:

I have a small applescript in Automator:

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

基本上,我想执行第一个shell脚本,然后在一分钟后执行第二个.

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

但是Automator会立即执行这两个操作.如何解决?

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

推荐答案

我发现的最简单方法:只是将作业传递给shell:

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"

这篇关于如何在一段时间内暂停执行applescript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆