我试图找到一种方法来自动化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弹出窗口的迹象等等)。为了完整起见,下面是我尝试过的脚本:
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有什么主意吗?!
发布于 2022-01-28 18:38:10
在与维护人员进行了一些协作之后,AppleScript VoiceOver控件现在可以用于GitHub操作。在默认情况下,所讨论的复选框已被选中。
发行:https://github.com/actions/virtual-environments/issues/4770
减贫战略:
https://stackoverflow.com/questions/70413370
复制相似问题