Skip to content

Consider using the VoiceOver AppleScript bridge instead of disabling System Integrity Protection (SIP) #74

@cookiecrook

Description

@cookiecrook

I have raised concerns a number of times (some of this captured in #11 and #12) about standardizing AT control from WebDriver in the form of the open key combo API proposal that is being proposed. This Key Press API requirement seems like a deal-breaker for security reasons, since the AT Driver group's current approach for Mac requires disabling System Integrity Protection (SIP).

That said, I do think that automating VoiceOver with different browsers on Mac is achievable with the existing AppleScript automation bridge in VoiceOver, and osascript.

See the full VoiceOver AppleScript interface in:

  • Script Editor.app > Window > Library > VoiceOver

Example functionality includes:

  • perform command text : The English name of the VoiceOver command to perform.
  • press
  • move [up/‌down/‌left/‌right or into item/‌out of item]
  • open [help menu/‌applications menu/‌windows menu/‌commands menu/‌item chooser/‌web menu/‌contextual menu or utility/‌quickstart/‌VoiceOver help]
  • last phrase
  • vo cursor > text under cursor
  • keyboard cursor > text under cursor

In particular, you may be interested in the functionality of perform command, which takes the string name of any VoiceOver command and executes it.

perform commandv

  • perform command text : The English name of the VoiceOver command to perform.

Likewise open, which gets you to a number of places Matt King wanted to verify.

open v

  • open [help menu/‌applications menu/‌windows menu/‌commands menu/‌item chooser/‌web menu/‌contextual menu or utility/‌quickstart/‌VoiceOver help] : the item to open

I believe this interface should give you as much functionality as the keyboard hotkey simulation your current AT Driver plans expect. Since you’re still planning to write a per-screenreader hotkey translation layer (command x is “a” on NVDA and “b” on VoiceOver), it seems reasonable that the translation layer could instead use the AppleScript bridge for any VO command sent via osascript, rather than the current proposal which requires disabling system integrity protection (SIP) and simulating KB HID events.

If for some reason, you find functionality that is not provided by VoiceOver’s AppleScript bridge, that may be addressable in a bug report or enhancement request.

As a tangent, if there was some functionality you need that is not provided by that bridge, there are potentially other ways to get it. For example, if you wanted more granular control and introspection into the speech synthesizer, you could embed new functionality in your own custom TTS voice. Which may help with the AT Driver testing, effectively inserting your script directly into VO’s speech output stream.

Sample code to develop a custom speech synthesizer, which for example could be used by VoiceOver, and log all speech jobs, or trigger other notifications when speech jobs were sent…
https://developer.apple.com/documentation/avfaudio/audio_engine/audio_units/creating_a_custom_speech_synthesizer?changes=_5&language=objc

I have mentioned the AppleScript and custom TTS voice paths before in AT Driver meetings and emails, but in less detail… I'm hopeful this GitHub issue can be a more permanent record.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Q1Internal classification of the proposed quarter to do the work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions