#macos #client #trusted #applications #prompt #api-client

deprecated macos-accessibility-client

Wrapper around macOS' accessibility client APIs

1 unstable release

0.0.1 Jan 9, 2021

#20 in #trusted

Download history 561/week @ 2023-12-07 842/week @ 2023-12-14 610/week @ 2023-12-21 830/week @ 2023-12-28 847/week @ 2024-01-04 556/week @ 2024-01-11 600/week @ 2024-01-18 762/week @ 2024-01-25 490/week @ 2024-02-01 481/week @ 2024-02-08 429/week @ 2024-02-15 440/week @ 2024-02-22 492/week @ 2024-02-29 563/week @ 2024-03-07 487/week @ 2024-03-14 450/week @ 2024-03-21

2,045 downloads per month
Used in 24 crates (3 directly)

MIT/Apache

4KB

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:

Screenshot of macOS accessibility 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 Jenß

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.

Dependencies

~235–325KB