AppleEvent 处理程序失败 (-10000)

use*_*492 5 macos applescript

我对脚本的一个简单部分有疑问,我想在其中获取属性dock preferences系统事件的属性。我有以下内容:

\n\n
tell application "System Events"\n    tell appearance preferences\n        set ap_prefs to (get the properties)\n        set ap_prefs to the properties\n    end tell\n    set a_pref to the properties of appearance preferences\n\n    -- Error Part\n    tell dock preferences\n        set d_prefs to (get the properties)\n    end tell\n    set d_pref to the properties of dock preferences\nend tell\n
Run Code Online (Sandbox Code Playgroud)\n\n

在上面的代码中,我appearance preferences以上面显示的所有方式访问,但不是dock preferences. 它给出一个错误error "System Events got an error: AppleEvent handler failed." number -10000

\n\n

那么到底发生了什么事,为什么只在码头上出现错误?这里@dj_bazzie_wazzie 说:

\n\n
\n

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

\n
\n\n

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

\n\n

干杯

\n

ada*_*one 0

这?

tell application "System Events" to get properties of dock preferences
Run Code Online (Sandbox Code Playgroud)