AppleEvent Handler failed (-10000)



我有一个简单的脚本部分的问题,在那里我想得到系统事件的属性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

那么发生了什么,为什么只有dock给出错误?这里@dj_bazzie_wazzie说:

Error -10000…大多数情况下,它不是目标错误,而是命令不完整或括号使用错误。

但是我想不出什么是正确的方法。我已经尝试了所有我能想到的,为什么它不抛出appearance preferences的异常?

欢呼

This?

tell application "System Events" to get properties of dock preferences

最新更新