Initial commit
This commit is contained in:
commit
d5c932d8e1
710 changed files with 50282 additions and 0 deletions
17
.tmp_axprobe/raise.swift
Executable file
17
.tmp_axprobe/raise.swift
Executable 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 ?? "?")")
|
||||
Loading…
Reference in a new issue