我正在尝试使用Applescript访问隐私->辅助功能选项卡。有谁可以帮我?
我需要在本节中显示所有程序的列表:
请求本身和终端中使用osascript -e的输出。
有必要排除与GUI的交互。这是我设法找到的
osascript -e 'tell application "System Events" to get the name of every login item'我需要为可访问性找到同样的解决方案吗?得到的结果和下面的截图一样。
主要目标是
来显示信息
发布于 2021-10-13 04:15:50
您应该按照以下方式对嵌套的引号进行转义。激活系统首选项。
osascript -e "
tell application id \"com.apple.systempreferences\"
activate
reveal anchor named \"Privacy_Accessibility\" in pane id \"com.apple.preference.security\"
end tell
tell application id \"sevs\" to tell process \"System Preferences\"
repeat until window \"Security & Privacy\" exists
delay 0.02
end repeat
tell scroll area 1 of group 1 of tab group 1 of window \"Security & Privacy\"
get value of static text 1 of UI element 1 of rows of table 1
end tell
end tell"或者,如果需要打开所需项(左侧)的表视图(右边),则可以在Catalina上使用以下记录:
osascript -e "
tell application id \"sevs\" to tell process \"System Preferences\"
set frontmost to true
tell scroll area 1 of group 1 of tab group 1 of window \"Security & Privacy\" to get value of static text 1 of UI element 1 of rows of table 1
end tell"https://stackoverflow.com/questions/69548089
复制相似问题