首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用AppleScript的隐私选项卡

使用AppleScript的隐私选项卡
EN

Stack Overflow用户
提问于 2021-10-12 23:38:41
回答 1查看 694关注 0票数 0

我正在尝试使用Applescript访问隐私->辅助功能选项卡。有谁可以帮我?

我需要在本节中显示所有程序的列表:

  • Accessibility
  • Camera
  • Microphone
  • Photos
  • etc...

请求本身和终端中使用osascript -e的输出。

有必要排除与GUI的交互。这是我设法找到的

代码语言:javascript
复制
osascript -e 'tell application "System Events" to get the name of every login item'

我需要为可访问性找到同样的解决方案吗?得到的结果和下面的截图一样。

主要目标是

  1. 本地获取安全和隐私中包含的信息2)通过SSH连接到mac,并获取安全和隐私中包含的信息。如果这是不可能的,那么如何使用单一的Apple .

来显示信息

EN

回答 1

Stack Overflow用户

发布于 2021-10-13 04:15:50

您应该按照以下方式对嵌套的引号进行转义。激活系统首选项。

代码语言:javascript
复制
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上使用以下记录:

代码语言:javascript
复制
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"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69548089

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档