【发布时间】:2014-11-01 16:19:57
【问题描述】:
如果我从终端运行以下命令
osascript -e 'tell application "System Events" to get UI elements enabled'
我按预期得到“真”或“假”
但是如果我要创建一个包含以下内容的文件;
#!/usr/bin/osascript
on supportsAssistiveDevices()
tell application "System Events"
set isEnabled to UI elements enabled
return isEnabled as boolean
end tell
end supportsAssistiveDevices
log supportsAssistiveDevices()
通过./myfile运行它,我得到以下错误;
./hasguiscript:87:106: execution error: An error of type -10810 has occurred. (-10810)
谁能帮忙解释一下为什么会这样?
谢谢。
【问题讨论】:
标签: macos applescript ui-automation osx-yosemite