macos-accessibility-client 0.0.2

Wrapper around macOS' accessibility client APIs
Documentation
  • Coverage
  • 50%
    4 out of 8 items documented0 out of 2 items with examples
  • Size
  • Source code size: 151.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 595.36 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • x3ro

macOS accessibility client

This crate, in its current state, only provides the functionality to query whether the running application is a trusted accessibility client, and if not, display the following rather well known prompt:

More functionality may be added in the future. Feel free to open an issue if you think there's something missing.

How to use:

#[cfg(target_os = "macos")]
fn query_accessibility_permissions() -> bool {
    let trusted = macos_accessibility_client::accessibility::application_is_trusted_with_prompt();
    if trusted {
        print!("Application is totally trusted!");
    } else {
        print!("Application isn't trusted :(");
    }
    return trusted
}

#[cfg(not(target_os = "macos"))]
fn query_accessibility_permissions() -> bool {
    print!("Who knows... 🤷‍♀️");
    return true
}

License

Copyright 2021 Lucas Jenss

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.