首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由VoiceOver控制AppleScript的自动化

由VoiceOver控制AppleScript的自动化
EN

Stack Overflow用户
提问于 2021-12-19 16:40:41
回答 1查看 175关注 0票数 1

我试图找到一种方法来自动化Allow VoiceOver to be controlled with AppleScript选项在VoiceOver Utility.app上的检查,以便VoiceOver可以由AppleScript控制。专门用于GitHub操作macos工作流。

据我所知,这是否启用是由/private/var/db/Accessibility/.VoiceOverAppleScriptEnabled文件的存在(包含单个字符的a (通过深入挖掘VoiceOver Utility /ScreenReaderCore.framework确定)驱动的,但是这个目录有VoiceOver Utility,因此写入文件是不可以的(禁用SIP选项)。

它似乎还试图导入一个.voprefs文件,并将SCREnableAppleScript键设置为true,这完全被忽略了。

尝试UI脚本单击复选框似乎只是在macos-11或MacOS10.15 env的GitHub操作中什么都不做,最后状态的屏幕截图看起来好像什么都没有发生(复选框仍未选中,没有SecurityAgent弹出窗口的迹象等等)。为了完整起见,下面是我尝试过的脚本:

代码语言:javascript
复制
delay 2

log "Starting AppleScript..."

do shell script "mkdir -p ./screenshots"
do shell script "screencapture ./screenshots/starting.png"

log "Activating VoiceOver Utility..."
tell application "VoiceOver Utility" to activate

delay 1

tell application "System Events"
    repeat while not (exists window 1 of application process "VoiceOver Utility")
        delay 0.1
    end repeat

    do shell script "screencapture ./screenshots/activated.png"

    log "Ticking checkbox..."

    tell application process "VoiceOver Utility"
        repeat until (exists checkbox 2 of splitter group 1 of window 1)
            delay 0.1
        end repeat

        click checkbox 2 of splitter group 1 of window 1
    end tell

    delay 2

    do shell script "screencapture ./screenshots/checkbox.png"
end tell

log "Quiting VoiceOver Utility..."
tell application "VoiceOver Utility"
  quit
end tell

有什么主意吗?!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-28 18:38:10

在与维护人员进行了一些协作之后,AppleScript VoiceOver控件现在可以用于GitHub操作。在默认情况下,所讨论的复选框已被选中。

发行:https://github.com/actions/virtual-environments/issues/4770

减贫战略:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70413370

复制
相关文章

相似问题

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