-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No AXUIElement
#624
Comments
No problem, please do!
That framework in particular is "CoreFoundation-like", and is not yet supported, see #556.
Hmm, I'm not too familiar with the accessibility frameworks, but if you have e.g. a NSView, I believe you can just import In any case, I can recommend the AccessKit project, they abstract a lot of this for you, and their source code probably contain similar things as what you're trying to do. |
unsafe {
let w = NSWorkspace::sharedWorkspace();
let a = w.frontmostApplication().unwrap();
dbg!(&a);
let e = a.accessibilityFocusedUIElement();
dbg!(e);
} I'll get
Thanks, I'll take a look! |
Try running with
(If debug assertions are enabled, then I'm not sure, but I'm beginning to suspect that |
I finally resolved it using https://github.com/eiz/accessibility. Thanks. |
First, I apologize for opening a question here.
Can I use this crate to get the currently selected text?
I did find
fn accessibilityFocusedUIElement(&self, ..)
andobjc2_app_kit::NSAccessibilityFocusedUIElementAttribute
. But I couldn't findAXUIElement
. So, how to obtain the&self
NSObjectNSAccessibility
? Then I can callaccessibilityFocusedUIElement
on it.The text was updated successfully, but these errors were encountered: