问题描述
|
我正在尝试创建一个AppleScript,用于设置“系统偏好设置”中“声音”菜单下“输入”类别的“输入音量”的值。
一个如何改变滑块的值?
tell application \"System Preferences\"
activate
set current pane to pane \"com.apple.preference.sound\"
end tell
tell application \"System Events\"
if UI elements enabled then
try
tell application process \"System Preferences\"
tell tab group 1 of window \"Sound\"
click radio button \"Input\"
select row 1 of table 1 of scroll area 1
set selected of row 1 of table 1 of scroll area 1 to true
set deviceselected to \"Microphone\"
set slider \"Input Volume\" of group \"Input Volume\" of tab group \"Input\" to 0
select row 2 of table 1 of scroll area 1
set selected of row 2 of table 1 of scroll area 1 to true
set deviceselected to \"Microphone\"
set slider \"Input Volume\" of group \"Input Volume\" of tab group \"Input\" to 0
end tell
end tell
end try
end if
end tell
这似乎不起作用。
我还尝试使用Accessibility Inspector来查找如何以以下方式分层访问元素,
value of slider of group \"Input volume\" of tab group \"Input\" of window \"Sound\"
这似乎也不是正确的方法。
这怎么了
编辑
set content of slider \"Input volume\" of tab group \"Input\" of window \"Sound\" of tab group 1 of window \"Sound\" of application process \"System Preferences\" to 0
--> error number -1700 from content of slider \"Input volume\" of tab group \"Input\" of window \"Sound\" of tab group 1 of window \"Sound\" of application **
因此它返回一个错误。我找不到错误代码-1700的任何描述,这是什么意思?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)