【发布时间】:2012-09-18 18:31:08
【问题描述】:
到目前为止,这是我的脚本:
property timeDelay : 5
on appOpen(appName)
tell application "System Events" to set appNameIsRunning to exists (processes where name is appName)
return appNameIsRunning
end appOpen
if appOpen("iChat") then
tell application "iChat"
repeat with theService in services
if connection status of theService = disconnected or connection status of theService = disconnecting then
log in of service (name of theService)
end if
end repeat
end tell
end if
基本上,如果您的任何 iChat/Messages 帐户已注销,它会检查一次。如果是,请登录。它可以工作。
不过,我希望这是一款“保持开放”的应用。过去我使用过该模式
on idle
-- do stuff
end idle
..但由于某种原因,当我尝试编译时出错。
知道为什么会这样吗?
编辑:
好的——仍然不确定为什么会发生这种情况,但我可以通过简单地制作一个新脚本来解决这个问题。我不知道为什么会出现这个错误,但现在看起来很好。谢谢大家的帮助。
【问题讨论】:
-
你应该用退货来代替你的延迟。
标签: osx-lion applescript