"Apple事件超时"的Corona SDK错误。

我正在使用Lua Glider for Corona SDK,在运行我的应用程序时,我遇到了错误“Apple事件超时”,而我正在使用Mac。我在插件控制台中得到了如下错误:

系统Lua解释器插件成功加载
Corona插件成功加载
Moai插件成功加载
Marmalade插件成功加载
Love2d插件成功加载
Gideros插件成功加载
56:74:执行错误:Corona Simulator出现错误:Apple Event超时。(-1712)

有人能帮助我吗?

点赞
用户1218135
用户1218135

这是一个苹果事件错误,这意味着您不能执行更多代码,因为您非常缓慢。

例如,您要定位Finder以复制大小为888 TB的文件夹。复制后,您想将新文件夹重命名为“duplicate gotta hey!” 这是代码:

在编辑器中打开此Scriplet:

tell application "Finder"
  duplicate alias "path:to:really BIG folder:"
  set name of result to "duplicate gotta hey!"
end tell

Finder将收到指令:“复制!”,而AppleScript将等待回应:“做完了,先生!”

如果AppleScript等待回复等得非常累,它就会超时并停止执行,抛出“AppleEvent timed out”错误。因此,“set name…”行不会被执行。

实际上,在AS 1.9.1中,AppleScript在等待2分钟后会变得很疲倦。但是,您可以使用以下语句防止这种情况发生:

在编辑器中打开此Scriplet:

with timeout of (30 * 60) seconds
  tell application "Finder"
    duplicate alias "path:to:really BIG folder:"
    set name of result to "duplicate gotta hey!"
  end tell
end timeout

现在,AppleScript将在30分钟后变得很疲倦!

请注意,仅当您定位进程(例如Finder)时,才会出现此错误。但是,如果您使用以下代码...

在编辑器中打开此Scriplet:

set aFolder to (choose folder with prompt "Choose a folder, please...")

...如果您是一个优柔寡断的人,您可能会等待17天才选择一个文件夹,但不会收到超时错误。

2013-12-19 06:45:03