首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >打开镜像并选择iPad的Applescript

打开镜像并选择iPad的Applescript
EN

Stack Overflow用户
提问于 2021-08-05 16:01:25
回答 1查看 132关注 0票数 0

我最近更新了我的mac到蒙特利,我的旧的applescript不再工作了,我得到了这个错误:‘系统事件得到一个错误:无法获取进程“系统偏好设置”的窗口1的弹出按钮1。索引无效。’

老实说,我不知道我应该改变哪一部分。提前谢谢你。

代码语言:javascript
复制
tell application "System Preferences"
    set current pane to pane "com.apple.preference.displays"
    activate
end tell

tell application "System Events"
    tell process "System Preferences"
        
        click pop up button 1 of window 1
        click menu item 1 of menu 1 of pop up button 1 of window 1
    end tell
end tell

tell application "System Preferences"
    delay 10
    quit
end tell

EN

回答 1

Stack Overflow用户

发布于 2021-11-13 13:55:56

代码语言:javascript
复制
tell application "System Preferences"
    reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
    activate
end tell

tell application "System Events"
    tell application process "System Preferences"
        click pop up button "Add Display" of window "Displays"
        click menu item 2 of menu 1 of pop up button "Add Display" of window "Displays"
    end tell
end tell

tell application "System Preferences"
    delay 5
    quit
end tell
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68669966

复制
相关文章

相似问题

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