我对脚本的一个简单部分有疑问,我想在其中获取属性dock preferences系统事件的属性。我有以下内容:
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\nRun Code Online (Sandbox Code Playgroud)\n\n在上面的代码中,我appearance preferences以上面显示的所有方式访问,但不是dock preferences. 它给出一个错误error "System Events got an error: AppleEvent handler failed." number -10000。
那么到底发生了什么事,为什么只在码头上出现错误?这里@dj_bazzie_wazzie 说:
\n\n\n\n\n错误-10000\xe2\x80\xa6大多数情况下它不是目标错误,而是命令不完整或括号使用错误。
\n
但我不知道什么是正确的方法。我已经尝试了我能想到的所有方法,为什么它不抛出异常appearance preferences?
干杯
\n这?
tell application "System Events" to get properties of dock preferences
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4644 次 |
| 最近记录: |