【发布时间】:2013-08-13 22:20:24
【问题描述】:
我有一个简单的苹果脚本,可以打开 Safari,打开网页 100 次(长篇故事),然后等待 300 秒关闭 Safari。
代码如下:
set theURL to "https://sites.google.com"
tell application "Safari"
activate
repeat 100 times
try
tell window 1 to set current tab to make new tab --with properties {URL:theURL}
set URL of document 1 to theURL
on error
open location theURL
end try
end repeat
end tell
delay 300
tell application "Safari"
quit
end tell
脚本的第一部分运行良好。当我通过延迟时,我收到一个错误:
错误“Safari 出现错误:用户已取消。”数字-128
我试图在不打开多个网页的情况下运行它只需激活 Safari,等待 10 秒然后退出。我遇到同样的问题。
有人处理过吗?
【问题讨论】:
标签: applescript