Initial commit
This commit is contained in:
commit
d5c932d8e1
710 changed files with 50282 additions and 0 deletions
15
.tmp_axprobe/hit2.swift
Executable file
15
.tmp_axprobe/hit2.swift
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
import Cocoa
|
||||
let px = Float(CommandLine.arguments[1])!, py = Float(CommandLine.arguments[2])!
|
||||
let sw = AXUIElementCreateSystemWide()
|
||||
var el: AXUIElement?
|
||||
guard AXUIElementCopyElementAtPosition(sw, px, py, &el) == .success, let el else { print("no hit"); exit(0) }
|
||||
func attr(_ a: String) -> String {
|
||||
var v: CFTypeRef?
|
||||
guard AXUIElementCopyAttributeValue(el, a as CFString, &v) == .success, let v else { return "<none>" }
|
||||
return String(describing: v).prefix(120).description
|
||||
}
|
||||
print("role=\(attr(kAXRoleAttribute))")
|
||||
print("pos=\(attr(kAXPositionAttribute)) size=\(attr(kAXSizeAttribute))")
|
||||
print("desc=\(attr(kAXDescriptionAttribute))")
|
||||
print("url=\(attr("AXURL"))")
|
||||
print("actions=\(attr("AXActionNames"))")
|
||||
Loading…
Reference in a new issue