options = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary let trusted = AXIsProcessTrustedWithOptions(options) if !trusted { ... }
-> CFTypeRef? { var v: CFTypeRef? return AXUIElementCopyAttributeValue(e, n as CFString, &v) == .success ? v : nil } func attr(_ e: AXUIElement, _ n: String, with arg: CFTypeRef) -> CFTypeRef? { var v: CFTypeRef? return AXUIElementCopyParameterizedAttributeValue(e, n as CFString, arg, &v) == .success ? v : nil } let start = attr(webArea, "AXStartTextMarker")! let end = attr(webArea, "AXEndTextMarker")! let range = attr( webArea, "AXTextMarkerRangeForUnorderedTextMarkers", with: [start, end] as CFArray )! let text = attr(webArea, "AXStringForTextMarkerRange", with: range) as? String
AXEndTextMarker Marker 文書の末尾を示すマーカー AXSelectedTextMarkerRange Range 選択中のテキストの範囲 AXTextInputMarkedTextMarkerRange Range IME変換中の未確定範囲 AXUIElementCopyAttributeValueで取れる属性
for the Macintosh https://www.applevis.com/forum/app-development-programming/work-progress-vosh-third-party-screen-reader-macintosh ‒ Vosh - a third-party screen-reader for the Macintosh https://github.com/Choominator/Vosh ‒ The State of Screen readers in macOS https://www.applevis.com/forum/macos-mac-apps/state-screen-readers-macos