【发布时间】:2015-11-04 06:28:26
【问题描述】:
我在脚本的一个简单部分遇到问题,我想在其中获取系统事件的属性 dock preferences。我有以下内容:
tell application "System Events"
tell appearance preferences
set ap_prefs to (get the properties)
set ap_prefs to the properties
end tell
set a_pref to the properties of appearance preferences
-- Error Part
tell dock preferences
set d_prefs to (get the properties)
end tell
set d_pref to the properties of dock preferences
end tell
在上面的代码中,我以上面显示的所有方式访问appearance preferences,但不是dock preferences。它给出了一个错误error "System Events got an error: AppleEvent handler failed." number -10000。
那么到底是怎么回事,为什么只给停靠栏出错? Here@dj_bazzie_wazzie 说:
错误-10000…大多数时候它不是目标错误,而是不完整的命令或括号的错误使用。
但我不知道什么是正确的方法。我已经尝试了所有我能想到的,为什么它不抛出appearance preferences的异常?
干杯
【问题讨论】:
-
工作正常 OMM (10.10.4)。你在什么操作系统上(也许旧版本有问题)?您是否对扩展坞应用了任何非标准设置/自定义?
-
@foo 我也在 10.10.4。我不记得对我的码头做过任何事情。我也没有任何可以控制扩展坞的第三方应用程序。
-
我预计 SE 会出现问题。即使在最好的时候,这绝对是一团糟。 (孩子们,不要在家里设计这样的软件!)您可以尝试单独获取
dock preferences对象的每个属性,看看它是否对其中一个或全部失败,然后file a bug 就可以了(不是我如果我是你,我会屏住呼吸等待结果)。 -
-
s/SE/System Events/g;
标签: macos applescript