Initial commit

This commit is contained in:
冰朔 2026-08-20 00:01:53 +08:00
commit d5c932d8e1
710 changed files with 50282 additions and 0 deletions

BIN
.tmp_axprobe/after.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
.tmp_axprobe/after2.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
.tmp_axprobe/after3.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
.tmp_axprobe/axon Executable file

Binary file not shown.

6
.tmp_axprobe/axon.swift Normal file
View file

@ -0,0 +1,6 @@
import Cocoa
let pid = pid_t(CommandLine.arguments[1])!
let app = AXUIElementCreateApplication(pid)
let t: CFTypeRef = kCFBooleanTrue!
let r = AXUIElementSetAttributeValue(app, "AXEnhancedUserInterface" as CFString, t)
print("set AXEnhancedUserInterface: \(r.rawValue)")

BIN
.tmp_axprobe/band Executable file

Binary file not shown.

23
.tmp_axprobe/band.swift Executable file
View file

@ -0,0 +1,23 @@
import Foundation
let data = try! Data(contentsOf: URL(fileURLWithPath: "shot.bmp"))
let pixOff = data.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) }
let w = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let B = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) })/8
let rowBytes = (B * w + 3) & ~3
var cols: [Int] = Array(repeating: 0, count: w)
for y in 365...400 {
let rowStart = Int(pixOff) + (hRaw > 0 ? (h-1-y) : y) * rowBytes
for x in 0..<w {
let i = rowStart + x * B
let b = Int(data[i]), g = Int(data[i+1]), r = Int(data[i+2])
if b > 120 && b > r + 30 && b > g + 15 && r < 160 { cols[x] += 1 }
}
}
var runs: [(Int,Int)] = []
var s = -1
for x in 0..<w {
if cols[x] > 3 && s < 0 { s = x }
if (cols[x] <= 3 || x == w-1) && s >= 0 { runs.append((s,x)); s = -1 }
}
for r in runs { print("blue run x=\(r.0)-\(r.1) width=\(r.1-r.0) center=\((r.0+r.1)/2)") }

BIN
.tmp_axprobe/blue Executable file

Binary file not shown.

34
.tmp_axprobe/blue.swift Executable file
View file

@ -0,0 +1,34 @@
import Foundation
let data = try! Data(contentsOf: URL(fileURLWithPath: "shot.bmp"))
// BMP header parsing
let pixOff = data.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) }
let w = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let bpp = data.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) }
let B = Int(bpp)/8; let rowBytes = (B * w + 3) & ~3
print("bmp \(w)x\(h) bpp=\(bpp) pixOff=\(pixOff)")
var minX = w, minY = h, maxX = 0, maxY = 0, count = 0
var rows: [Int] = Array(repeating: 0, count: h)
for y in 0..<h {
let rowStart = Int(pixOff) + (hRaw > 0 ? (h - 1 - y) : y) * rowBytes
for x in 0..<w {
let i = rowStart + x * B
let b = data[i], g = data[i+1], r = data[i+2]
let ri = Int(r), gi = Int(g), bi = Int(b)
// blue button detection
if bi > 120 && bi > ri + 30 && bi > gi + 15 && ri < 160 {
count += 1; rows[y] += 1
if x < minX { minX = x }; if x > maxX { maxX = x }
if y < minY { minY = y }; if y > maxY { maxY = y }
}
}
}
print("bluePixels=\(count) bbox=(\(minX),\(minY))-(\(maxX),\(maxY))")
// row profile to separate blobs
var bands: [(Int,Int,Int)] = []
var start = -1
for y in 0..<h {
if rows[y] > 20 && start < 0 { start = y }
if (rows[y] <= 20 || y == h-1) && start >= 0 { bands.append((start, y, (start...y).map{rows[$0]}.max()!)); start = -1 }
}
for bd in bands { print("band y=\(bd.0)-\(bd.1) maxRowPx=\(bd.2)") }

22
.tmp_axprobe/capwin.swift Executable file
View file

@ -0,0 +1,22 @@
import Cocoa
let pid = pid_t(CommandLine.arguments[1])!
let out = CommandLine.arguments[2]
guard let wins = CGWindowListCopyWindowInfo([.optionOnScreenOnly], kCGNullWindowID) as? [[String: Any]] else { exit(1) }
for w in wins {
if (w[kCGWindowOwnerPID as String] as? Int) == pid,
(w[kCGWindowLayer as String] as? Int) == 0,
let wid = w[kCGWindowNumber as String] as? Int,
let bd = w[kCGWindowBounds as String] as? [String: Any],
(bd["Width"] as! Double) > 400 {
if let img = CGWindowListCreateImage(.null, .optionIncludingWindow, CGWindowID(wid), [.boundsIgnoreFraming]) {
let url = URL(fileURLWithPath: out)
if let dest = CGImageDestinationCreateWithURL(url as CFURL, "public.png" as CFString, 1, nil) {
CGImageDestinationAddImage(dest, img, nil)
CGImageDestinationFinalize(dest)
print("saved \(out) size=\(img.width)x\(img.height)")
}
} else { print("capture failed") }
exit(0)
}
}
print("no window found")

2418
.tmp_axprobe/cg_tree.txt Executable file

File diff suppressed because it is too large Load diff

65
.tmp_axprobe/chrome_tree.txt Executable file
View file

@ -0,0 +1,65 @@
AXWindow (135,30 1804x1320) t=光湖 · 国内入口 - Google Chrome d= v=
AXGroup (135,30 1804x1320) t=光湖 · 国内入口 - Google Chrome d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,70 1804x80) t= d= v=
AXToolbar (135,70 1804x46) t= d= v=
AXButton (141,76 34x34) t= d=返回 v=
AXButton (177,76 34x34) t= d=前进 v=
AXButton (213,76 34x34) t= d=重新加载 v=
AXGroup (256,76 1508x34) t= d= v=
AXPopUpButton (261,81 24x24) t= d=查看网站信息 v=
AXTextField (293,81 1427x24) t= d=地址和搜索栏 v=guanghulab.com
AXGroup (1728,81 24x24) t= d= v=
AXGroup (1752,81 0x24) t= d= v=
AXGroup (1773,76 70x34) t= d= v=
AXPopUpButton (1773,76 34x34) t= d=ChatGPT
可以访问此网站 v=
AXPopUpButton (1809,76 34x34) t= d=扩展程序 v=
AXGroup (1852,85 2x16) t= d= v=
AXButton (1863,76 34x34) t= d=BEI v=
AXPopUpButton (1899,76 34x34) t= d=Chrome v=
AXToolbar (135,116 1804x34) t= d=书签 v=
AXToolbar (141,116 559x28) t= d=已保存的标签页分组 v=
AXButton (141,120 132x20) t= d=“📝 发布中文 README”分组 - 已关闭 v=
AXButton (281,120 102x20) t= d=“🛟 京东原生救援”分组 - 已关闭 v=
AXButton (391,120 145x20) t= d=“🍎 HoloLake TestFlight”分组 - 已关闭 v=
AXButton (544,120 112x20) t= d=“🔧 HoloLake 入库”分组 - 已关闭 v=
AXButton (664,116 28x28) t= d=标签页分组 v=
AXSplitter (700,122 10x16) t= d=分隔符 v=
AXButton (710,116 58x28) t= d=百度 v=
AXButton (772,116 150x28) t= d=猫读中文网 / 首页 ,爱生活,爱阅读,中国移动手机阅读,手机电子书下载,言情小说,全本小说,TXT小说下载,总裁小说 v=
AXButton (926,116 150x28) t= d=咪咕文学网—咪咕数媒旗下作者服务平台 v=
AXButton (1080,116 106x28) t= d=登录企业邮箱 v=
AXButton (1190,116 150x28) t= d=腾讯企业邮箱 - 收件箱 v=
AXButton (1344,116 150x28) t= d=Kimi.ai - 会推理解析,能深度思考的AI助手 v=
AXButton (1498,116 114x28) t= d=BiXin Network v=
AXButton (1616,116 74x28) t= d=Claude v=
AXPopUpButton (1799,116 28x28) t= d=包含隐藏书签的菜单 v=
AXPopUpButton (1845,116 86x28) t= d=所有书签 v=
AXSplitter (1827,122 18x16) t= d=分隔符 v=
AXGroup (135,150 1804x1200) t= d= v=
AXGroup (135,150 1804x1200) t= d= v=
AXGroup (135,151 1804x1199) t= d= v=
AXGroup (135,151 1804x0) t= d= v=
AXWebArea (135,151 1804x1199) t=光湖 · 国内入口 d= v=
AXGroup (135,150 1804x1) t= d= v=
AXGroup (221,30 1718x41) t= d= v=
AXGroup (227,30 28x41) t= d= v=
AXPopUpButton (227,36 28x28) t= d=标签页搜索 v=
AXGroup (249,30 970x41) t= d= v=
AXTabGroup (249,30 970x41) t= d= v=
AXRadioButton (249,30 256x41) t= d=服务器 - 轻量云 - 控制台 v=0
AXRadioButton (487,30 256x41) t= d=腾讯云 OrcaTerm v=0
AXRadioButton (725,30 256x41) t= d=新标签页 v=0
AXRadioButton (963,30 256x41) t= d=光湖 · 国内入口 v=1
AXGroup (249,30 970x41) t= d= v=
AXButton (1213,30 28x41) t= d=新标签页 v=
AXGroup (1253,30 686x41) t= d= v=
AXGroup (135,30 0x0) t= d= v=
AXButton (147,42 16x16) t= d= v=
AXButton (193,42 16x16) t= d= v=
AXGroup (194,44 14x14) t= d= v=
AXGroup (194,44 14x14) t= d= v=
AXButton (170,42 16x16) t= d= v=

126
.tmp_axprobe/chrome_tree2.txt Executable file
View file

@ -0,0 +1,126 @@
AXWindow (135,30 1804x1320) t=光湖 · 国内入口 - Google Chrome d= v=
AXGroup (135,30 1804x1320) t=光湖 · 国内入口 - Google Chrome d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,30 1804x1320) t= d= v=
AXGroup (135,70 1804x80) t= d= v=
AXToolbar (135,70 1804x46) t= d= v=
AXButton (141,76 34x34) t= d=返回 v=
AXButton (177,76 34x34) t= d=前进 v=
AXButton (213,76 34x34) t= d=重新加载 v=
AXGroup (256,76 1508x34) t= d= v=
AXPopUpButton (261,81 24x24) t= d=查看网站信息 v=
AXTextField (293,81 1427x24) t= d=地址和搜索栏 v=guanghulab.com
AXGroup (1728,81 24x24) t= d= v=
AXButton (1728,81 24x24) t= d=为此标签页修改书签 v=
AXGroup (1752,81 0x24) t= d= v=
AXGroup (1773,76 70x34) t= d= v=
AXPopUpButton (1773,76 34x34) t= d=ChatGPT
可以访问此网站 v=
AXPopUpButton (1809,76 34x34) t= d=扩展程序 v=
AXGroup (1852,85 2x16) t= d= v=
AXButton (1863,76 34x34) t= d=BEI v=
AXPopUpButton (1899,76 34x34) t= d=Chrome v=
AXToolbar (135,116 1804x34) t= d=书签 v=
AXToolbar (141,116 559x28) t= d=已保存的标签页分组 v=
AXButton (141,120 132x20) t= d=“📝 发布中文 README”分组 - 已关闭 v=
AXButton (281,120 102x20) t= d=“🛟 京东原生救援”分组 - 已关闭 v=
AXButton (391,120 145x20) t= d=“🍎 HoloLake TestFlight”分组 - 已关闭 v=
AXButton (544,120 112x20) t= d=“🔧 HoloLake 入库”分组 - 已关闭 v=
AXButton (664,116 28x28) t= d=标签页分组 v=
AXSplitter (700,122 10x16) t= d=分隔符 v=
AXButton (710,116 58x28) t= d=百度 v=
AXButton (772,116 150x28) t= d=猫读中文网 / 首页 ,爱生活,爱阅读,中国移动手机阅读,手机电子书下载,言情小说,全本小说,TXT小说下载,总裁小说 v=
AXButton (926,116 150x28) t= d=咪咕文学网—咪咕数媒旗下作者服务平台 v=
AXButton (1080,116 106x28) t= d=登录企业邮箱 v=
AXButton (1190,116 150x28) t= d=腾讯企业邮箱 - 收件箱 v=
AXButton (1344,116 150x28) t= d=Kimi.ai - 会推理解析,能深度思考的AI助手 v=
AXButton (1498,116 114x28) t= d=BiXin Network v=
AXButton (1616,116 74x28) t= d=Claude v=
AXPopUpButton (1799,116 28x28) t= d=包含隐藏书签的菜单 v=
AXPopUpButton (1845,116 86x28) t= d=所有书签 v=
AXSplitter (1827,122 18x16) t= d=分隔符 v=
AXGroup (135,150 1804x1200) t= d= v=
AXGroup (135,150 1804x1200) t= d= v=
AXGroup (135,151 1804x1199) t= d= v=
AXGroup (135,151 1804x0) t= d= v=
AXWebArea (135,151 1804x1199) t=光湖 · 国内入口 d= v=
AXGroup (440,151 1180x1) t= d= v=
AXLink (480,151 248x1) t= d=光湖首页 v=
AXStaticText (506,151 49x1) t= d= v=光湖
AXGroup (506,151 222x1) t= d= v=
AXStaticText (506,151 222x1) t= d= v=GUANGHU LANGUAGE WORLD
AXStaticText (1432,151 148x1) t= d= v=广州备案前门 · 在线
AXGroup (135,151 1789x1124) t= d= v=
AXGroup (440,151 1180x294) t= d= v=
AXGroup (880,151 300x1) t= d= v=
AXStaticText (880,151 300x1) t= d= v=GUANGHU · DOMESTIC ENTRY
AXHeading (788,151 484x1) t=一处入口,连接光湖 d= v=
AXStaticText (788,151 376x1) t= d= v=一处入口,连接
AXStaticText (1164,151 108x1) t= d= v=光湖
AXGroup (740,151 580x11) t= d= v=
AXStaticText (741,151 578x4) t= d= v=这里不承载重型应用,只提供稳定、清晰的真实路径。代码与服务运行在国内主节点,旧第
AXLink (833,200 209x53) t= d=进入光湖代码频道 v=
AXStaticText (866,215 144x23) t= d= v=进入光湖代码频道
AXLink (1058,200 169x53) t= d=AI 读取路径 v=
AXStaticText (1092,215 102x23) t= d= v=AI 读取路径
AXGroup (440,486 1180x637) t=三条主路径 d= v=
AXStaticText (852,621 130x16) t= d= v=THREE ROUTES
AXHeading (1003,594 205x49) t=三条主路径 d= v=
AXStaticText (1003,594 205x49) t= d= v=三条主路径
AXLink (480,695 351x356) t= d=HOLOLAKE CODE CHANNEL 光湖代码频道 新的代码写入与协作入口。公开仓库可由 AI 直接读取,人类保留登录操作。 ENTER ↗ v=
AXStaticText (556,854 198x15) t= d= v=HOLOLAKE CODE CHANNEL
AXHeading (583,881 144x30) t=光湖代码频道 d= v=
AXStaticText (583,881 144x30) t= d= v=光湖代码频道
AXGroup (509,925 293x58) t= d= v=
AXStaticText (516,931 279x46) t= d= v=新的代码写入与协作入口。公开仓库可由 AI 直接读取,人类保留登录操作。
AXStaticText (618,1003 74x17) t= d= v=ENTER ↗
AXLink (854,695 351x356) t= d=MACHINE ENTRY AI 路径入口 按编号查找仓库、节点、人格路径和当前事实,不需要猜地址。 ENTER ↗ v=
AXStaticText (968,854 123x15) t= d= v=MACHINE ENTRY
AXHeading (962,881 135x30) t=AI 路径入口 d= v=
AXStaticText (962,881 135x30) t= d= v=AI 路径入口
AXGroup (883,925 293x58) t= d= v=
AXStaticText (892,931 276x46) t= d= v=按编号查找仓库、节点、人格路径和当前事实,不需要猜地址。
AXStaticText (993,1003 74x17) t= d= v=ENTER ↗
AXLink (1229,695 351x356) t= d=COMMIT PULSE · LIVE 脉 · 提交实时投影 三个主仓库的每一次推送在这里实时亮起,点进任何一条,直达那次提交的现场。 ENTER ↗ v=
AXStaticText (1315,854 179x15) t= d= v=COMMIT PULSE · LIVE
AXHeading (1307,881 195x30) t=脉 · 提交实时投影 d= v=
AXStaticText (1307,881 195x30) t= d= v=脉 · 提交实时投影
AXGroup (1258,925 293x58) t= d= v=
AXStaticText (1259,931 291x46) t= d= v=三个主仓库的每一次推送在这里实时亮起,点进任何一条,直达那次提交的现场。
AXStaticText (1367,1003 74x17) t= d= v=ENTER ↗
AXGroup (440,1123 1180x152) t= d=辅助入口 v=
AXLink (813,1158 110x21) t= d=全局路径检索 v=
AXStaticText (827,1159 96x18) t= d= v=全局路径检索
AXLink (967,1158 110x21) t= d=国内应用节点 v=
AXStaticText (981,1159 96x18) t= d= v=国内应用节点
AXLink (1120,1158 127x21) t= d=新加坡历史仓库 v=
AXStaticText (1134,1159 113x18) t= d= v=新加坡历史仓库
AXGroup (135,1274 1789x76) t= d= v=
AXStaticText (746,1305 186x16) t= d= v=光湖语言世界 · 国内备案入口
AXStaticText (965,1303 151x17) t= d= v=© 2026 Guanghu Lab
AXLink (1149,1303 165x20) t= d=陕ICP备2025071211号-1 v=
AXStaticText (1149,1305 165x16) t= d= v=陕ICP备2025071211号-1
AXGroup (135,150 1804x1) t= d= v=
AXGroup (221,30 1718x41) t= d= v=
AXGroup (227,30 28x41) t= d= v=
AXPopUpButton (227,36 28x28) t= d=标签页搜索 v=
AXGroup (249,30 970x41) t= d= v=
AXTabGroup (249,30 970x41) t= d= v=
AXRadioButton (249,30 256x41) t= d=服务器 - 轻量云 - 控制台 v=0
AXButton (463,36 28x28) t= d=关闭 v=
AXRadioButton (487,30 256x41) t= d=腾讯云 OrcaTerm v=0
AXButton (701,36 28x28) t= d=关闭 v=
AXRadioButton (725,30 256x41) t= d=新标签页 v=0
AXButton (939,36 28x28) t= d=关闭 v=
AXRadioButton (963,30 256x41) t= d=光湖 · 国内入口 v=1
AXButton (1177,36 28x28) t= d=关闭 v=
AXGroup (249,30 970x41) t= d= v=
AXButton (1213,30 28x41) t= d=新标签页 v=
AXGroup (1253,30 686x41) t= d= v=
AXGroup (135,30 0x0) t= d= v=
AXButton (147,42 16x16) t= d= v=
AXButton (193,42 16x16) t= d= v=
AXGroup (194,44 14x14) t= d= v=
AXGroup (194,44 14x14) t= d= v=
AXButton (170,42 16x16) t= d= v=

BIN
.tmp_axprobe/click Executable file

Binary file not shown.

11
.tmp_axprobe/click.swift Executable file
View file

@ -0,0 +1,11 @@
import Cocoa
let p = CGPoint(x: Double(CommandLine.arguments[1])!, y: Double(CommandLine.arguments[2])!)
let mv = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: p, mouseButton: .left)
mv?.post(tap: .cghidEventTap)
usleep(300_000)
let down = CGEvent(mouseEventSource: nil, mouseType: .leftMouseDown, mouseCursorPosition: p, mouseButton: .left)
down?.post(tap: .cghidEventTap)
usleep(80_000)
let up = CGEvent(mouseEventSource: nil, mouseType: .leftMouseUp, mouseCursorPosition: p, mouseButton: .left)
up?.post(tap: .cghidEventTap)
print("clicked at (\(p.x), \(p.y))")

BIN
.tmp_axprobe/cmp Executable file

Binary file not shown.

18
.tmp_axprobe/cmp.swift Executable file
View file

@ -0,0 +1,18 @@
import Foundation
func btnColor(_ path: String) -> String {
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
let pixOff = data.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) }
let w = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let B = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) })/8
let rowBytes = (B * w + 3) & ~3
// button center in this capture: window-rel (500,548); capture is nominalResolution(1x?) -> check size
let sx = 500.0 * Double(w) / 1161.0
let sy = 548.0 * Double(h) / 1102.0
let x = Int(sx), y = Int(sy)
let rowStart = Int(pixOff) + (hRaw > 0 ? (h-1-y) : y) * rowBytes
let i = rowStart + x * B
return "size=\(w)x\(h) px(\(x),\(y)) BGR=(\(data[i]),\(data[i+1]),\(data[i+2]))"
}
print("AWAY: " + btnColor("away.bmp"))
print("OVER: " + btnColor("over.bmp"))

BIN
.tmp_axprobe/crop.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

BIN
.tmp_axprobe/diff Executable file

Binary file not shown.

30
.tmp_axprobe/diff.swift Executable file
View file

@ -0,0 +1,30 @@
import Foundation
func region(_ path: String) -> (avgB: Double, avgG: Double, avgR: Double, blueCount: Int, blueRuns: [(Int,Int)]) {
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
let pixOff = data.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) }
let w = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let B = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) })/8
let rowBytes = (B * w + 3) & ~3
var sb = 0.0, sg = 0.0, sr = 0.0, n = 0, blue = 0
var cols = [Int](repeating: 0, count: w)
for y in 360...400 {
let rowStart = Int(pixOff) + (hRaw > 0 ? (h-1-y) : y) * rowBytes
for x in 250...460 {
let i = rowStart + x * B
let b = Int(data[i]), g = Int(data[i+1]), r = Int(data[i+2])
sb += Double(b); sg += Double(g); sr += Double(r); n += 1
if b > 120 && b > r + 30 && b > g + 15 && r < 160 { blue += 1; cols[x] += 1 }
}
}
var runs: [(Int,Int)] = []; var s = -1
for x in 250...460 {
if cols[x] > 2 && s < 0 { s = x }
if (cols[x] <= 2 || x == 460) && s >= 0 { runs.append((s,x)); s = -1 }
}
return (sb/Double(n), sg/Double(n), sr/Double(n), blue, runs)
}
let a = region("shot.bmp")
let b = region("new.bmp")
print(String(format: "OLD : avgB=%.1f avgG=%.1f avgR=%.1f bluePx=%d runs=%@", a.avgB, a.avgG, a.avgR, a.blueCount, "\(a.blueRuns)"))
print(String(format: "NEW : avgB=%.1f avgG=%.1f avgR=%.1f bluePx=%d runs=%@", b.avgB, b.avgG, b.avgR, b.blueCount, "\(b.blueRuns)"))

BIN
.tmp_axprobe/diff2 Executable file

Binary file not shown.

41
.tmp_axprobe/diff2.swift Executable file
View file

@ -0,0 +1,41 @@
import Foundation
let args = CommandLine.arguments
func region(_ path: String) -> (avgB: Double, avgR: Double, blueCount: Int, runs: [(Int,Int)]) {
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
let pixOff = data.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) }
let w = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let B = Int(data.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) })/8
let rowBytes = (B * w + 3) & ~3
var sb = 0.0, sr = 0.0, n = 0, blue = 0
var cols = [Int](repeating: 0, count: w)
for y in 355...405 {
let rowStart = Int(pixOff) + (hRaw > 0 ? (h-1-y) : y) * rowBytes
for x in 250...460 {
let i = rowStart + x * B
let b = Int(data[i]), g = Int(data[i+1]), r = Int(data[i+2])
sb += Double(b); sr += Double(r); n += 1
if b > 120 && b > r + 30 && b > g + 15 && r < 160 { blue += 1; cols[x] += 1 }
}
}
var runs: [(Int,Int)] = []; var s = -1
for x in 250...460 {
if cols[x] > 2 && s < 0 { s = x }
if (cols[x] <= 2 || x == 460) && s >= 0 { runs.append((s,x)); s = -1 }
}
return (sb/Double(n), sr/Double(n), blue, runs)
}
// whole-image diff stats
func wholediff(_ p1: String, _ p2: String) -> (changed: Int, total: Int) {
let d1 = try! Data(contentsOf: URL(fileURLWithPath: p1))
let d2 = try! Data(contentsOf: URL(fileURLWithPath: p2))
var c = 0; let n = min(d1.count, d2.count)
var i = 0
while i < n { if d1[i] != d2[i] { c += 1 }; i += 64 }
return (c, n/64)
}
let a = region(args[1]); let b = region(args[2])
print(String(format: "A(%@): avgB=%.1f avgR=%.1f bluePx=%d runs=%@", args[1], a.avgB, a.avgR, a.blueCount, "\(a.runs)"))
print(String(format: "B(%@): avgB=%.1f avgR=%.1f bluePx=%d runs=%@", args[2], b.avgB, b.avgR, b.blueCount, "\(b.runs)"))
let wd = wholediff(args[1], args[2])
print(String(format: "WHOLEDIFF: sampled bytes differ=%d / %d", wd.changed, wd.total))

BIN
.tmp_axprobe/diff3 Executable file

Binary file not shown.

40
.tmp_axprobe/diff3.swift Executable file
View file

@ -0,0 +1,40 @@
import Foundation
func load(_ path: String) -> (Data, Int, Int, Int, Int) {
let d = try! Data(contentsOf: URL(fileURLWithPath: path))
let pixOff = Int(d.withUnsafeBytes { $0.load(fromByteOffset: 10, as: UInt32.self) })
let w = Int(d.withUnsafeBytes { $0.load(fromByteOffset: 18, as: Int32.self) })
let hRaw = Int(d.withUnsafeBytes { $0.load(fromByteOffset: 22, as: Int32.self) }); let h = abs(hRaw)
let B = Int(d.withUnsafeBytes { $0.load(fromByteOffset: 28, as: UInt16.self) })/8
let rb = (B*w+3) & ~3
return (d, pixOff, w, h, hRaw > 0 ? 1 : 0) // 1 = bottom-up
}
let (A, poA, w, h, flipA) = load("new.bmp")
let (B2, poB, _, _, flipB) = load("after3.bmp")
let rb = (4*w+3) & ~3
let BS = 45
var blocks: [(Int,Int,Int)] = []
var y = 0
while y < h { var x = 0
while x < w {
var diff = 0
var yy = y; while yy < min(y+BS, h) {
let ra = poA + (flipA==1 ? (h-1-yy) : yy) * rb
let rb2 = poB + (flipB==1 ? (h-1-yy) : yy) * rb
var xx = x; while xx < min(x+BS, w) {
let ia = ra + xx*4, ib = rb2 + xx*4
let dr = abs(Int(A[ia+2]) - Int(B2[ib+2]))
let dg = abs(Int(A[ia+1]) - Int(B2[ib+1]))
let db = abs(Int(A[ia]) - Int(B2[ib]))
if dr+dg+db > 60 { diff += 1 }
xx += 2
}
yy += 2
}
if diff > 8 { blocks.append((x,y,diff)) }
x += BS
}
y += BS
}
print("changed blocks (x,y,diffPx):")
for b in blocks { print(" x=\(b.0)-\(b.0+BS) y=\(b.1)-\(b.1+BS) px=\(b.2)") }
if blocks.isEmpty { print(" none") }

BIN
.tmp_axprobe/hit Executable file

Binary file not shown.

17
.tmp_axprobe/hit.swift Executable file
View file

@ -0,0 +1,17 @@
import Cocoa
let px = Float(CommandLine.arguments[1])!, py = Float(CommandLine.arguments[2])!
let sw = AXUIElementCreateSystemWide()
var el: AXUIElement?
let r = AXUIElementCopyElementAtPosition(sw, px, py, &el)
print("hitResult=\(r.rawValue)")
if let el {
func attr(_ e: AXUIElement, _ a: String) -> String {
var v: CFTypeRef?
guard AXUIElementCopyAttributeValue(e, a as CFString, &v) == .success else { return "?" }
return "\(v!)"
}
print("role=\(attr(el, kAXRoleAttribute)) title=\(attr(el, kAXTitleAttribute)) desc=\(attr(el, kAXDescriptionAttribute))")
var pid: pid_t = 0; AXUIElementGetPid(el, &pid)
let owner = NSRunningApplication(processIdentifier: pid)?.localizedName ?? "?"
print("ownerPid=\(pid) owner=\(owner)")
}

BIN
.tmp_axprobe/hit2 Executable file

Binary file not shown.

15
.tmp_axprobe/hit2.swift Executable file
View 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"))")

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
.tmp_axprobe/hover Executable file

Binary file not shown.

31
.tmp_axprobe/hover.swift Executable file
View file

@ -0,0 +1,31 @@
import Cocoa
// move mouse to (849,707) global logical, no click
let move = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: CGPoint(x: 849, y: 707), mouseButton: .left)
move?.post(tap: .cghidEventTap)
usleep(400_000)
// query AX element at that point for pid 1668
let app = AXUIElementCreateApplication(1668)
var el: AXUIElement?
let err = AXUIElementCopyElementAtPosition(app, 849, 707, &el)
print("AXUIElementCopyElementAtPosition err=\(err.rawValue)")
if let el = el {
func s(_ a: String) -> String {
var v: CFTypeRef?
if AXUIElementCopyAttributeValue(el, a as CFString, &v) == .success, let st = v as? String { return st.replacingOccurrences(of: "\n", with: "⏎") }
return ""
}
print("role=\(s(kAXRoleAttribute)) title=\(s(kAXTitleAttribute)) value=\(String(s(kAXValueAttribute).prefix(80))) desc=\(s(kAXDescriptionAttribute)) url=\(s(kAXURLAttribute))")
// walk up parents a few levels
var cur = el
for _ in 0..<5 {
var p: CFTypeRef?
guard AXUIElementCopyAttributeValue(cur, kAXParentAttribute as CFString, &p) == .success, let pp = p else { break }
cur = pp as! AXUIElement
var v: CFTypeRef?
var role = "", val = ""
if AXUIElementCopyAttributeValue(cur, kAXRoleAttribute as CFString, &v) == .success { role = (v as? String) ?? "" }
v = nil
if AXUIElementCopyAttributeValue(cur, kAXValueAttribute as CFString, &v) == .success { val = String(((v as? String) ?? "").prefix(50)).replacingOccurrences(of: "\n", with: "⏎") }
print(" parent role=\(role) val=\(val)")
}
}

18
.tmp_axprobe/hovercheck.swift Executable file
View file

@ -0,0 +1,18 @@
import Cocoa
func moveMouse(_ x: CGFloat, _ y: CGFloat) {
let ev = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: CGPoint(x: x, y: y), mouseButton: .left)
ev?.post(tap: .cghidEventTap)
}
func capture(_ name: String) {
let rect = CGRect(x: 349, y: 159, width: 1161, height: 1102)
guard let img = CGWindowListCreateImage(rect, .optionOnScreenOnly, kCGNullWindowID, [.boundsIgnoreFraming, .nominalResolution]) else { print("capture fail"); return }
let url = URL(fileURLWithPath: name)
guard let dest = CGImageDestinationCreateWithURL(url as CFURL, "public.png" as CFString, 1, nil) else { return }
CGImageDestinationAddImage(dest, img, nil)
CGImageDestinationFinalize(dest)
print("captured \(name) \(img.width)x\(img.height)")
}
moveMouse(1900, 1350); usleep(600_000)
capture("away.png")
moveMouse(849, 707); usleep(700_000)
capture("over.png")

BIN
.tmp_axprobe/mtest Executable file

Binary file not shown.

11
.tmp_axprobe/mtest.swift Executable file
View file

@ -0,0 +1,11 @@
import Cocoa
let p = CGPoint(x: 849, y: 707)
let before = CGEvent(source: nil)?.location ?? .zero
print("before: \(before)")
let mv = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: p, mouseButton: .left)
if mv == nil { print("CGEvent creation FAILED") }
mv?.post(tap: .cghidEventTap)
usleep(400_000)
let after = CGEvent(source: nil)?.location ?? .zero
print("after: \(after)")
print(mv == nil ? "NO PERMISSION TO CREATE?" : "event created ok")

BIN
.tmp_axprobe/mv Executable file

Binary file not shown.

5
.tmp_axprobe/mv.swift Executable file
View file

@ -0,0 +1,5 @@
import Cocoa
let args = CommandLine.arguments
let x = Double(args[1])!, y = Double(args[2])!
let ev = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: CGPoint(x: x, y: y), mouseButton: .left)
ev?.post(tap: .cghidEventTap)

BIN
.tmp_axprobe/new.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
.tmp_axprobe/probe Executable file

Binary file not shown.

48
.tmp_axprobe/probe.swift Executable file
View file

@ -0,0 +1,48 @@
import Cocoa
let app = AXUIElementCreateApplication(1668)
func attr(_ e: AXUIElement, _ name: String) -> CFTypeRef? {
var v: CFTypeRef?
return AXUIElementCopyAttributeValue(e, name as CFString, &v) == .success ? v : nil
}
func frame(_ e: AXUIElement) -> String {
var p = CGPoint.zero, s = CGSize.zero
if let pv = attr(e, kAXPositionAttribute), let sv = attr(e, kAXSizeAttribute) {
AXValueGetValue(pv as! AXValue, .cgPoint, &p)
AXValueGetValue(sv as! AXValue, .cgSize, &s)
return String(format: "(%.0f,%.0f %.0fx%.0f)", p.x, p.y, s.width, s.height)
}
return "?"
}
func str(_ e: AXUIElement, _ a: String) -> String {
if let v = attr(e, a) as? String { return v.replacingOccurrences(of: "\n", with: " ") }
return ""
}
var found = 0
func walk(_ e: AXUIElement, _ depth: Int) {
if found > 40 { return }
let t = str(e, kAXTitleAttribute), v = str(e, kAXValueAttribute), d = str(e, kAXDescriptionAttribute)
let all = t + v + d
if all.contains("批准") || all.contains("拒绝") || all.contains("待审批") || all.contains("画中画") || all.contains("HoloLake") {
print("[HIT d\(depth)] role=\(str(e,kAXRoleAttribute)) title='\(String(t.prefix(60)))' val='\(String(v.prefix(60)))' desc='\(String(d.prefix(60)))' frame=\(frame(e))")
found += 1
}
if let kidsAny = attr(e, kAXChildrenAttribute) as? [AnyObject] {
let kids = kidsAny.map { $0 as! AXUIElement }
for k in kids { walk(k, depth+1) }
}
}
if let wins = attr(app, kAXWindowsAttribute) as? [AXUIElement] {
print("windowCount=\(wins.count)")
for (i,w) in wins.enumerated() {
print("win[\(i)] title='\(str(w,kAXTitleAttribute))' frame=\(frame(w))")
walk(w, 0)
}
}
if let f0 = attr(app, kAXFocusedUIElementAttribute) {
let f = f0 as! AXUIElement
print("FOCUSED role=\(str(f,kAXRoleAttribute)) frame=\(frame(f)) desc='\(String(str(f,kAXDescriptionAttribute).prefix(40)))'")
}

BIN
.tmp_axprobe/probe2 Executable file

Binary file not shown.

41
.tmp_axprobe/probe2.swift Executable file
View file

@ -0,0 +1,41 @@
import Cocoa
let app = AXUIElementCreateApplication(1668)
func info(_ x: Float, _ y: Float) -> String {
var el: AXUIElement?
guard AXUIElementCopyElementAtPosition(app, x, y, &el) == .success, let el = el else { return "none" }
func s(_ a: String) -> String {
var v: CFTypeRef?
if AXUIElementCopyAttributeValue(el, a as CFString, &v) == .success, let st = v as? String { return String(st.prefix(40)).replacingOccurrences(of: "\n", with: "⏎") }
return ""
}
var nkids = "?"
if var kids: CFTypeRef? = nil, AXUIElementCopyAttributeValue(el, kAXChildrenAttribute as CFString, &kids) == .success, let arr = kids as? [AnyObject] { nkids = "\(arr.count)" }
return "role=\(s(kAXRoleAttribute)) val='\(s(kAXValueAttribute))' desc='\(s(kAXDescriptionAttribute))' kids=\(nkids)"
}
print("P(849,707) [button center]: " + info(849, 707))
print("P(1450,1211) [send btn ctrl]: " + info(1450, 1211))
print("P(600,900) [chat text ctrl]: " + info(600, 900))
print("P(400,400) [sidebar ctrl]: " + info(400, 400))
// descend into element at (849,707) to find buttons
var el: AXUIElement?
if AXUIElementCopyElementAtPosition(app, 849, 707, &el) == .success, let root = el {
var stack: [(AXUIElement, Int)] = [(root, 0)]
var seen = 0
while let (e, d) = stack.popLast(), seen < 80 {
var v: CFTypeRef?
var role = ""
if AXUIElementCopyAttributeValue(e, kAXRoleAttribute as CFString, &v) == .success { role = (v as? String) ?? "?" }
v = nil
var val = ""
if AXUIElementCopyAttributeValue(e, kAXValueAttribute as CFString, &v) == .success, let st = v as? String { val = String(st.prefix(30)).replacingOccurrences(of: "\n", with: "⏎") }
v = nil
var desc = ""
if AXUIElementCopyAttributeValue(e, kAXDescriptionAttribute as CFString, &v) == .success, let st = v as? String { desc = String(st.prefix(30)).replacingOccurrences(of: "\n", with: "⏎") }
print("d\(d) \(role) val='\(val)' desc='\(desc)'")
seen += 1
v = nil
if AXUIElementCopyAttributeValue(e, kAXChildrenAttribute as CFString, &v) == .success, let arr = v as? [AnyObject] {
for k in arr.reversed() { stack.append((k as! AXUIElement, d+1)) }
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,212 @@
AXWindow (354,225 1440x1044) t=Quest Window d= v=
AXGroup (354,225 1440x1044) t=Quest Window d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXWebArea (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (624,225 4x1044) t= d= v=
AXGroup (354,225 1440x1044) t= d= v=
AXGroup (354,225 272x1044) t= d= v=
AXGroup (354,225 272x1044) t= d= v=
AXToolbar (436,225 52x40) t= d= v=
AXButton (436,233 24x24) t= d=收起Quest列表 (⌘B) v=
AXButton (464,233 24x24) t= d=搜索 (⌘P) v=
AXGroup (354,269 272x1000) t= d= v=
AXButton (366,273 248x36) t=创建 Quest ⌘ N d= v=
AXStaticText (403,284 65x15) t= d= v=创建 Quest
AXStaticText (578,285 12x12) t= d= v=⌘
AXStaticText (593,285 8x12) t= d= v=N
AXGroup (354,317 272x746) t= d= v=
AXGroup (354,317 272x746) t= d= v=
AXButton (371,324 154x18) t=Quests d= v=
AXButton (533,322 22x22) t= d=查看全部 v=
AXPopUpButton (559,322 22x22) t= d=自定义侧栏 v=
AXPopUpButton (585,322 22x22) t= d=添加工作区 v=
AXGroup (363,352 252x27) t= d= v=
AXButton (371,356 188x19) t=铸渊-ICE-GL-ZY001 d= v=
AXGroup (567,356 18x19) t= d= v=
AXPopUpButton (567,356 18x19) t= d=更多操作 v=
AXButton (589,356 18x19) t= d=创建 Quest v=
AXGroup (363,383 252x30) t= d= v=
AXButton (371,391 14x14) t= d=置顶 v=
AXImage (371,391 14x14) t= d= v=
AXGroup (393,389 96x18) t= d= v=
AXStaticText (393,391 96x14) t= d= v=恢复铸渊人格系统
AXStaticText (585,391 22x14) t= d= v=刚刚
AXGroup (589,389 18x18) t= d= v=
AXPopUpButton (589,389 18x18) t= d= v=
AXGroup (363,414 252x30) t= d= v=
AXButton (371,422 14x14) t= d=置顶 v=
AXImage (371,422 14x14) t= d= v=
AXGroup (393,420 72x18) t= d= v=
AXStaticText (393,422 72x14) t= d= v=人格系统恢复
AXStaticText (578,422 29x14) t= d= v=3小时
AXGroup (589,420 18x18) t= d= v=
AXPopUpButton (589,420 18x18) t= d= v=
AXGroup (363,445 252x30) t= d= v=
AXButton (371,453 14x14) t= d=置顶 v=
AXImage (371,453 14x14) t= d= v=
AXGroup (393,451 96x18) t= d= v=
AXStaticText (393,453 96x14) t= d= v=恢复铸渊人格系统
AXStaticText (573,453 34x14) t= d= v=14小时
AXGroup (589,451 18x18) t= d= v=
AXPopUpButton (589,451 18x18) t= d= v=
AXGroup (363,476 252x30) t= d= v=
AXButton (371,484 14x14) t= d=置顶 v=
AXImage (371,484 14x14) t= d= v=
AXGroup (393,482 96x18) t= d= v=
AXStaticText (393,484 96x14) t= d= v=铸渊人格系统恢复
AXStaticText (589,484 18x14) t= d= v=2天
AXGroup (589,482 18x18) t= d= v=
AXPopUpButton (589,482 18x18) t= d= v=
AXGroup (363,507 252x30) t= d= v=
AXButton (371,515 14x14) t= d=置顶 v=
AXImage (371,515 14x14) t= d= v=
AXGroup (393,513 96x18) t= d= v=
AXStaticText (393,515 96x14) t= d= v=铸渊人格系统恢复
AXStaticText (589,515 18x14) t= d= v=2天
AXGroup (589,513 18x18) t= d= v=
AXPopUpButton (589,513 18x18) t= d= v=
AXButton (363,537 252x31) t= d=展示更多 v=
AXGroup (355,575 268x27) t= d= v=
AXButton (371,581 210x19) t=Chats d= v=
AXButton (589,581 18x19) t= d=新建 Chat v=
AXGroup (363,610 252x30) t= d= v=
AXButton (371,618 14x14) t= d=置顶 v=
AXImage (371,618 14x14) t= d= v=
AXGroup (393,616 153x18) t= d= v=
AXStaticText (393,618 142x14) t= d= v=额度恢复模型不可用问题排查
AXStaticText (573,618 34x14) t= d= v=12小时
AXGroup (589,616 18x18) t= d= v=
AXPopUpButton (589,616 18x18) t= d= v=
AXGroup (363,641 252x30) t= d= v=
AXButton (371,649 14x14) t= d=置顶 v=
AXImage (371,649 14x14) t= d= v=
AXGroup (393,647 104x18) t= d= v=
AXStaticText (393,649 104x14) t= d= v=token计划恢复测试
AXStaticText (573,649 34x14) t= d= v=12小时
AXGroup (589,647 18x18) t= d= v=
AXPopUpButton (589,647 18x18) t= d= v=
AXGroup (363,672 252x30) t= d= v=
AXButton (371,680 14x14) t= d=置顶 v=
AXImage (371,680 14x14) t= d= v=
AXGroup (393,678 72x18) t= d= v=
AXStaticText (393,680 72x14) t= d= v=人格系统恢复
AXStaticText (591,680 16x14) t= d= v=1天
AXGroup (589,678 18x18) t= d= v=
AXPopUpButton (589,678 18x18) t= d= v=
AXGroup (363,703 252x30) t= d= v=
AXButton (371,711 14x14) t= d=置顶 v=
AXImage (371,711 14x14) t= d= v=
AXGroup (393,709 96x18) t= d= v=
AXStaticText (393,711 96x14) t= d= v=人格系统路径恢复
AXStaticText (591,711 16x14) t= d= v=1天
AXGroup (589,709 18x18) t= d= v=
AXPopUpButton (589,709 18x18) t= d= v=
AXGroup (354,317 6x746) t= d= v=
AXGroup (620,317 6x746) t= d= v=
AXTabGroup (362,1071 256x132) t= d=设置 v=
AXRadioButton (362,1071 256x30) t=定时任务 d= v=0
AXRadioButton (362,1105 256x30) t=Better Harness Beta d= v=0
AXRadioButton (362,1139 256x30) t=知识中心 d= v=0
AXRadioButton (362,1173 256x30) t=插件市场 d= v=0
AXGroup (362,1211 256x50) t= d= v=
AXImage (366,1225 28x28) t= d=勤奋的冰朔 v=
AXGroup (404,1221 65x18) t= d= v=
AXStaticText (404,1223 65x15) t= d= v=勤奋的冰朔
AXGroup (404,1239 65x18) t= d= v=
AXStaticText (404,1241 36x14) t= d= v=高级版
AXGroup (556,1225 28x28) t= d= v=
AXButton (556,1225 28x28) t= d=额度用量 v=
AXGroup (586,1225 28x28) t= d= v=
AXPopUpButton (586,1225 28x28) t= d=设置 v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x2) t= d= v=
AXGroup (626,1267 1168x2) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (1792,225 2x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,267 1168x4) t= d= v=
AXGroup (626,225 1168x1044) t= d= v=
AXGroup (626,225 1168x44) t= d= v=
AXGroup (626,225 1168x44) t= d= v=
AXGroup (626,225 8x40) t= d= v=
AXToolbar (634,225 0x40) t= d= v=
AXGroup (634,225 888x44) t= d= v=
AXGroup (634,225 259x44) t= d= v=
AXStaticText (650,240 104x15) t= d= v=恢复铸渊人格系统
AXStaticText (762,240 111x14) t= d= v=铸渊-ICE-GL-ZY001
AXGroup (877,240 15x14) t= d= v=
AXStaticText (877,240 15x14) t= d= v=
AXButton (1522,236 122x22) t= d=一周年限时好礼 v=
AXButton (1650,235 78x24) t= d=打开编辑器 v=
AXGroup (1736,235 28x24) t= d= v=
AXPopUpButton (1736,235 24x24) t= d=更多操作 v=
AXButton (1764,235 24x24) t= d=打开面板 v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (626,269 1168x1000) t= d= v=
AXGroup (1757,277 37x142) t= d= v=
AXToolbar (1764,284 24x128) t= d=产物快捷入口 v=
AXButton (1764,284 24x24) t= d=概要 v=
AXGroup (1768,288 16x16) t= d= v=
AXStaticText (1768,288 16x16) t= d= v=
AXButton (1764,310 24x24) t= d=终端 v=
AXGroup (1768,314 16x16) t= d= v=
AXStaticText (1768,314 16x16) t= d= v=
AXButton (1766,336 24x24) t= d=文件 v=
AXGroup (1770,340 16x16) t= d= v=
AXStaticText (1770,340 16x16) t= d= v=
AXButton (1764,362 24x24) t= d=审查 v=
AXGroup (1768,366 16x16) t= d= v=
AXStaticText (1768,366 16x16) t= d= v=
AXButton (1764,388 24x24) t= d=浏览器 v=
AXGroup (1768,392 16x16) t= d= v=
AXStaticText (1768,392 16x16) t= d= v=
AXGroup (626,1269 1168x0) t= d= v=
AXGroup (354,225 1x1) t= d= v=
AXGroup (354,225 1x1) t= d= v=
AXGroup (354,225 1x1) t= d= v=
AXGroup (354,225 1x1) t= d= v=
AXGroup (354,225 1x1) t= d= v=
AXStaticText (354,226 1x70) t= d= v=命令成功
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d= v=
AXGroup (354,1269 1440x0) t= d=Notifications alt+T v=
AXGroup (354,1269 1440x0) t= d=Notifications alt+T v=
AXImage (354,225 1x1) t= d= v=
AXGroup (354,1269 1440x0) t= d=Notifications alt+T v=
AXGroup (354,1269 1440x0) t= d=Notifications alt+T v=
AXGroup (354,225 1440x1044) t= d= v=
AXButton (368,238 16x16) t= d= v=
AXButton (414,238 16x16) t= d= v=
AXGroup (415,239 14x14) t= d= v=
AXGroup (415,239 14x14) t= d= v=
AXButton (391,238 16x16) t= d= v=

BIN
.tmp_axprobe/raise Executable file

Binary file not shown.

17
.tmp_axprobe/raise.swift Executable file
View file

@ -0,0 +1,17 @@
import Cocoa
let app = NSRunningApplication(processIdentifier: 1668)
app?.activate(options: [.activateIgnoringOtherApps])
usleep(300_000)
let axApp = AXUIElementCreateApplication(1668)
var windowsRef: CFTypeRef?
AXUIElementCopyAttributeValue(axApp, kAXWindowsAttribute as CFString, &windowsRef)
if let wins = windowsRef as? [AXUIElement] {
for (i, w) in wins.enumerated() {
var tRef: CFTypeRef?
AXUIElementCopyAttributeValue(w, kAXTitleAttribute as CFString, &tRef)
let t = (tRef as? String) ?? "?"
let r = AXUIElementPerformAction(w, kAXRaiseAction as CFString)
print("window \(i) title=\(t) raise=\(r.rawValue)")
}
}
print("frontmost now: \(NSWorkspace.shared.frontmostApplication?.localizedName ?? "?")")

BIN
.tmp_axprobe/shot.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
.tmp_axprobe/tree Executable file

Binary file not shown.

41
.tmp_axprobe/tree.swift Executable file
View file

@ -0,0 +1,41 @@
import Cocoa
let pid = pid_t(CommandLine.arguments[1])!
let maxDepth = CommandLine.arguments.count > 2 ? Int(CommandLine.arguments[2])! : 12
let app = AXUIElementCreateApplication(pid)
func str(_ e: AXUIElement, _ a: String) -> String {
var v: CFTypeRef?
guard AXUIElementCopyAttributeValue(e, a as CFString, &v) == .success else { return "" }
return "\(v!)"
}
func pos(_ e: AXUIElement) -> String {
var v: CFTypeRef?
guard AXUIElementCopyAttributeValue(e, kAXPositionAttribute as CFString, &v) == .success else { return "" }
var p = CGPoint.zero
AXValueGetValue(v as! AXValue, .cgPoint, &p)
var v2: CFTypeRef?
guard AXUIElementCopyAttributeValue(e, kAXSizeAttribute as CFString, &v2) == .success else { return "\(p)" }
var s = CGSize.zero
AXValueGetValue(v2 as! AXValue, .cgSize, &s)
return String(format: "(%.0f,%.0f %.0fx%.0f)", p.x, p.y, s.width, s.height)
}
var count = 0
func walk(_ e: AXUIElement, _ depth: Int) {
if depth > maxDepth || count > 3000 { return }
count += 1
let role = str(e, kAXRoleAttribute)
let title = str(e, kAXTitleAttribute)
let desc = str(e, kAXDescriptionAttribute)
let val = str(e, kAXValueAttribute)
let indent = String(repeating: " ", count: depth)
print("\(indent)\(role) \(pos(e)) t=\(title) d=\(desc) v=\(val.prefix(40))")
var kids: CFTypeRef?
if AXUIElementCopyAttributeValue(e, kAXChildrenAttribute as CFString, &kids) == .success, let arr = kids as? [AXUIElement] {
for k in arr { walk(k, depth+1) }
}
}
var winRef: CFTypeRef?
if AXUIElementCopyAttributeValue(app, kAXFocusedWindowAttribute as CFString, &winRef) == .success {
walk(winRef as! AXUIElement, 0)
} else {
print("no focused window")
}

BIN
.tmp_axprobe/tree2 Executable file

Binary file not shown.

BIN
.tmp_axprobe/url Executable file

Binary file not shown.

23
.tmp_axprobe/url.swift Executable file
View file

@ -0,0 +1,23 @@
import Cocoa
let pid = pid_t(CommandLine.arguments[1])!
let app = AXUIElementCreateApplication(pid)
var wRef: CFTypeRef?
AXUIElementCopyAttributeValue(app, kAXFocusedWindowAttribute as CFString, &wRef)
func findWeb(_ e: AXUIElement, _ depth: Int) {
if depth > 12 { return }
var r: CFTypeRef?
AXUIElementCopyAttributeValue(e, kAXRoleAttribute as CFString, &r)
if (r as? String) == "AXWebArea" {
var u: CFTypeRef?
AXUIElementCopyAttributeValue(e, "AXURL" as CFString, &u)
var t: CFTypeRef?
AXUIElementCopyAttributeValue(e, kAXTitleAttribute as CFString, &t)
print("WebArea title=\(String(describing: t)) url=\(String(describing: u))")
return
}
var kids: CFTypeRef?
if AXUIElementCopyAttributeValue(e, kAXChildrenAttribute as CFString, &kids) == .success, let arr = kids as? [AXUIElement] {
for k in arr { findWeb(k, depth+1) }
}
}
if let w = wRef { findWeb(w as! AXUIElement, 0) }

BIN
.tmp_axprobe/winlist Executable file

Binary file not shown.

17
.tmp_axprobe/winlist.swift Executable file
View file

@ -0,0 +1,17 @@
import Cocoa
let px = Double(CommandLine.arguments[1])!, py = Double(CommandLine.arguments[2])!
if let wins = CGWindowListCopyWindowInfo([.optionAll], kCGNullWindowID) as? [[String: Any]] {
for w in wins {
let name = w[kCGWindowOwnerName as String] as? String ?? "?"
let title = w[kCGWindowName as String] as? String ?? ""
let layer = w[kCGWindowLayer as String] as? Int ?? -1
let pid = w[kCGWindowOwnerPID as String] as? Int ?? -1
var b = CGRect.null
if let d = w[kCGWindowBounds as String] as? [String: Any] {
b = CGRect(x: d["X"] as! Double, y: d["Y"] as! Double, width: d["Width"] as! Double, height: d["Height"] as! Double)
}
let onTop = w[kCGWindowIsOnscreen as String] as? Bool ?? false
let contains = b.contains(CGPoint(x: px, y: py))
print("layer=\(layer) onScreen=\(onTop) pid=\(pid) owner=\(name) title=\(title) bounds=\(b) containsPoint=\(contains)")
}
}

BIN
.tmp_axprobe/wins Executable file

Binary file not shown.

14
.tmp_axprobe/wins.swift Executable file
View file

@ -0,0 +1,14 @@
import Cocoa
let opts: CGWindowListOption = [.optionOnScreenOnly, .excludeDesktopElements]
if let list = CGWindowListCopyWindowInfo(opts, kCGNullWindowID) as? [[String: Any]] {
for w in list {
let pid = w[kCGWindowOwnerPID as String] as? Int ?? -1
if pid == 1668 || pid == ProcessInfo.processInfo.processIdentifier {
let b = w[kCGWindowBounds as String] as? [String: CGFloat] ?? [:]
let name = w[kCGWindowName as String] as? String ?? ""
let layer = w[kCGWindowLayer as String] as? Int ?? -1
let alpha = w[kCGWindowAlpha as String] as? Double ?? -1
print("pid=\(pid) layer=\(layer) alpha=\(alpha) name='\(name)' bounds=\(b)")
}
}
}

BIN
.tmp_axprobe/wins2 Executable file

Binary file not shown.

108
.tmp_axprobe/wl.txt Executable file
View file

@ -0,0 +1,108 @@
layer=0 onScreen=false pid=1742 owner=ChatGPT Computer Use title= bounds=(1049.0, 825.0, 66.0, 20.0) containsPoint=false
layer=0 onScreen=false pid=43412 owner=ThemeWidgetControlViewService title= bounds=(696.0, 176.0, 66.0, 20.0) containsPoint=false
layer=0 onScreen=true pid=41137 owner=HoloLake title= bounds=(696.0, 176.0, 66.0, 20.0) containsPoint=false
layer=0 onScreen=false pid=43412 owner=ThemeWidgetControlViewService title= bounds=(745.0, 179.0, 14.0, 14.0) containsPoint=false
layer=0 onScreen=false pid=41137 owner=HoloLake title= bounds=(0.0, 940.0, 500.0, 500.0) containsPoint=false
layer=0 onScreen=false pid=7284 owner=ThemeWidgetControlViewService title= bounds=(411.0, 175.0, 14.0, 14.0) containsPoint=false
layer=0 onScreen=false pid=795 owner=CursorUIViewService title= bounds=(669.0, 1169.0, 64.0, 64.0) containsPoint=false
layer=0 onScreen=false pid=795 owner=CursorUIViewService title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=0 onScreen=false pid=50485 owner=ThemeWidgetControlViewService title= bounds=(145.0, 41.0, 66.0, 20.0) containsPoint=false
layer=0 onScreen=true pid=89844 owner=Google Chrome title= bounds=(145.0, 41.0, 66.0, 20.0) containsPoint=false
layer=0 onScreen=false pid=50485 owner=ThemeWidgetControlViewService title= bounds=(194.0, 44.0, 14.0, 14.0) containsPoint=false
layer=2147483630 onScreen=true pid=413 owner=Window Server title=StatusIndicator bounds=(2385.0, 1.0, 29.0, 28.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 1.0, 1.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 1.0, 1.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(234.0, 55.0, 1552.0, 138.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(234.0, 55.0, 1552.0, 88.0) containsPoint=false
layer=0 onScreen=true pid=89844 owner=Google Chrome title= bounds=(135.0, 30.0, 1804.0, 1320.0) containsPoint=true
layer=0 onScreen=false pid=37303 owner=自动填充 title= bounds=(307.0, 982.0, 312.0, 237.0) containsPoint=false
layer=24 onScreen=true pid=413 owner=Window Server title=Menubar bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=-2147483602 onScreen=true pid=413 owner=Window Server title= bounds=(0.0, 0.0, 2560.0, 122.0) containsPoint=false
layer=0 onScreen=true pid=641 owner=访达 title= bounds=(611.0, 405.0, 920.0, 574.0) containsPoint=true
layer=103 onScreen=false pid=89844 owner=Google Chrome title= bounds=(165.0, 112.0, 177.0, 19.0) containsPoint=false
layer=0 onScreen=false pid=89873 owner=自动填充 title= bounds=(135.0, 1113.0, 312.0, 237.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=89844 owner=Google Chrome title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=3 onScreen=false pid=645 owner=辅助功能 title= bounds=(0.0, 990.0, 0.0, 0.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2149.0, 0.0, 36.0, 30.0) containsPoint=false
layer=2147483631 onScreen=true pid=840 owner=百度输入法 title= bounds=(1173.0, 1185.0, 534.0, 99.0) containsPoint=false
layer=0 onScreen=false pid=50879 owner=ThemeWidgetControlViewService title= bounds=(1049.0, 825.0, 66.0, 20.0) containsPoint=false
layer=3 onScreen=false pid=1742 owner=ChatGPT Computer Use title= bounds=(0.0, 1384.0, 155.0, 56.0) containsPoint=false
layer=102 onScreen=true pid=1742 owner=ChatGPT Computer Use title= bounds=(1754.0, 188.0, 126.0, 126.0) containsPoint=false
layer=0 onScreen=false pid=1742 owner=ChatGPT Computer Use title= bounds=(0.0, 1208.0, 600.0, 264.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(1996.0, 0.0, 67.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=1743 owner=自动填充 title= bounds=(235.0, 1022.0, 312.0, 237.0) containsPoint=false
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(530.0, 356.0, 1072.0, 855.0) containsPoint=true
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=3 onScreen=false pid=89844 owner=Google Chrome title= bounds=(1006.0, 298.0, 548.0, 252.0) containsPoint=false
layer=8 onScreen=false pid=781 owner=Wi-Fi title= bounds=(1055.0, 513.0, 450.0, 210.0) containsPoint=false
layer=103 onScreen=false pid=1448 owner=Clash Verge title= bounds=(1350.0, 1021.0, 57.0, 19.0) containsPoint=false
layer=0 onScreen=false pid=795 owner=CursorUIViewService title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=0 onScreen=false pid=1945 owner=nsattributedstringagent title= bounds=(0.0, 0.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=969 owner=通用控制 title= bounds=(0.0, 0.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=41137 owner=HoloLake title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=true pid=1668 owner=ChatGPT title= bounds=(349.0, 159.0, 1161.0, 1102.0) containsPoint=true
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(0.0, 940.0, 500.0, 500.0) containsPoint=false
layer=1 onScreen=false pid=840 owner=百度输入法 title= bounds=(0.0, 1440.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=41137 owner=HoloLake title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=1668 owner=ChatGPT title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=101 onScreen=false pid=1033 owner=DockHelper title= bounds=(1175.0, 1161.0, 196.0, 178.0) containsPoint=false
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(307.0, 175.0, 1440.0, 1044.0) containsPoint=true
layer=1 onScreen=false pid=840 owner=百度输入法 title= bounds=(0.0, 1440.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=2 onScreen=false pid=840 owner=百度输入法 title= bounds=(2512.0, 1180.0, 48.0, 50.0) containsPoint=false
layer=0 onScreen=false pid=1668 owner=ChatGPT title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2111.0, 0.0, 38.0, 30.0) containsPoint=false
layer=1 onScreen=false pid=840 owner=百度输入法 title= bounds=(0.0, 1440.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=795 owner=CursorUIViewService title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=0 onScreen=false pid=1668 owner=ChatGPT title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=2147483631 onScreen=false pid=840 owner=百度输入法 title= bounds=(0.0, 1439.0, 1.0, 1.0) containsPoint=false
layer=0 onScreen=false pid=1668 owner=ChatGPT title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=839 owner=AutoFill title= bounds=(2.0, 1009.0, 312.0, 237.0) containsPoint=false
layer=0 onScreen=false pid=37218 owner=Qoder CN title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=20 onScreen=false pid=840 owner=百度输入法 title= bounds=(2038.0, 1262.0, 219.0, 88.0) containsPoint=false
layer=-2147483601 onScreen=true pid=734 owner=通知中心 title= bounds=(8.0, 218.0, 180.0, 180.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2219.0, 0.0, 34.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(0.0, 940.0, 500.0, 500.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2063.0, 0.0, 48.0, 30.0) containsPoint=false
layer=-2147483601 onScreen=true pid=734 owner=通知中心 title= bounds=(8.0, 38.0, 180.0, 180.0) containsPoint=false
layer=0 onScreen=false pid=1448 owner=Clash Verge title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=78587 owner=nsattributedstringagent title= bounds=(0.0, 0.0, 0.0, 0.0) containsPoint=false
layer=0 onScreen=false pid=763 owner=Raycast title= bounds=(0.0, 940.0, 500.0, 500.0) containsPoint=false
layer=2147483630 onScreen=true pid=413 owner=Window Server title=StatusIndicator bounds=(2385.0, 1.0, 29.0, 28.0) containsPoint=false
layer=2147483628 onScreen=false pid=760 owner=TextInputSwitcher title= bounds=(1156.0, 580.0, 247.0, 220.0) containsPoint=false
layer=0 onScreen=false pid=796 owner=聚焦 title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2335.0, 0.0, 32.0, 30.0) containsPoint=false
layer=23 onScreen=false pid=796 owner=聚焦 title= bounds=(680.0, 448.0, 844.0, 577.0) containsPoint=true
layer=8 onScreen=false pid=763 owner=Raycast title= bounds=(0.0, 966.0, 750.0, 474.0) containsPoint=false
layer=23 onScreen=false pid=796 owner=聚焦 title= bounds=(782.0, 448.0, 640.0, 56.0) containsPoint=false
layer=0 onScreen=false pid=641 owner=访达 title= bounds=(0.0, 940.0, 64.0, 64.0) containsPoint=false
layer=0 onScreen=false pid=641 owner=访达 title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=641 owner=访达 title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=641 owner=访达 title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=0 onScreen=false pid=641 owner=访达 title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2253.0, 0.0, 44.0, 30.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2367.0, 0.0, 42.0, 30.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2297.0, 0.0, 38.0, 30.0) containsPoint=false
layer=-2147483603 onScreen=true pid=641 owner=访达 title= bounds=(0.0, 0.0, 2560.0, 1440.0) containsPoint=true
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2409.0, 0.0, 151.0, 30.0) containsPoint=false
layer=21 onScreen=false pid=734 owner=通知中心 title= bounds=(0.0, 0.0, 2560.0, 1440.0) containsPoint=true
layer=-2147483624 onScreen=true pid=638 owner=程序坞 title=Wallpaper- bounds=(0.0, 0.0, 2560.0, 1440.0) containsPoint=true
layer=20 onScreen=true pid=638 owner=程序坞 title= bounds=(0.0, 0.0, 2560.0, 1440.0) containsPoint=true
layer=0 onScreen=true pid=41137 owner=HoloLake title= bounds=(690.0, 170.0, 1180.0, 760.0) containsPoint=true
layer=3 onScreen=false pid=1668 owner=ChatGPT title= bounds=(669.0, 1156.0, 84.0, 77.0) containsPoint=false
layer=0 onScreen=false pid=795 owner=CursorUIViewService title= bounds=(0.0, 1376.0, 64.0, 64.0) containsPoint=false
layer=101 onScreen=false pid=763 owner=Raycast title= bounds=(2.0, 1009.0, 312.0, 237.0) containsPoint=false
layer=2147483630 onScreen=false pid=413 owner=Window Server title= bounds=(844.0, 723.0, 28.0, 40.0) containsPoint=false
layer=0 onScreen=false pid=41137 owner=HoloLake title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=3 onScreen=false pid=1668 owner=ChatGPT title= bounds=(2164.0, 1040.0, 408.0, 400.0) containsPoint=false
layer=0 onScreen=false pid=41137 owner=HoloLake title= bounds=(0.0, 0.0, 2560.0, 30.0) containsPoint=false
layer=25 onScreen=true pid=639 owner=控制中心 title= bounds=(2185.0, 0.0, 34.0, 30.0) containsPoint=false
layer=-2147483626 onScreen=true pid=413 owner=Window Server title= bounds=(0.0, 0.0, 2560.0, 1440.0) containsPoint=true

BIN
.tmp_axprobe/zyset Executable file

Binary file not shown.

14
.tmp_axprobe/zyset.swift Normal file
View file

@ -0,0 +1,14 @@
import Cocoa
let pid = pid_t(CommandLine.arguments[1])!
let app = AXUIElementCreateApplication(pid)
var focused: CFTypeRef?
AXUIElementCopyAttributeValue(app, kAXFocusedUIElementAttribute as CFString, &focused)
if let f = focused {
var r1: CFTypeRef?
AXUIElementCopyAttributeValue(f as! AXUIElement, kAXRoleAttribute as CFString, &r1)
print("focused role: \(r1 as? String ?? "?")")
let setR = AXUIElementSetAttributeValue(f as! AXUIElement, kAXValueAttribute as CFString, "ZYSET-PROBE" as CFTypeRef)
print("set value result: \(setR.rawValue) (0=success)")
// 立即清空,不留痕
AXUIElementSetAttributeValue(f as! AXUIElement, kAXValueAttribute as CFString, "" as CFTypeRef)
} else { print("no focused element") }

BIN
.tmp_axprobe/zywin Executable file

Binary file not shown.

14
.tmp_axprobe/zywin.swift Normal file
View file

@ -0,0 +1,14 @@
import Cocoa
let opts: CGWindowListOption = [.optionOnScreenOnly, .excludeDesktopElements]
if let list = CGWindowListCopyWindowInfo(opts, kCGNullWindowID) as? [[String: Any]] {
for w in list {
let pid = w[kCGWindowOwnerPID as String] as? Int ?? -1
let owner = w[kCGWindowOwnerName as String] as? String ?? "?"
let name = w[kCGWindowName as String] as? String ?? ""
let b = w[kCGWindowBounds as String] as? [String: CGFloat] ?? [:]
let layer = w[kCGWindowLayer as String] as? Int ?? -1
if layer == 0 {
print("pid=\(pid) owner=\(owner) name='\(name)' bounds=\(b)")
}
}
}