MCPcopy Create free account
hub / github.com/altic-dev/FluidVoice / getCurrentAppInfo

Method getCurrentAppInfo

Sources/Fluid/ContentView.swift:1603–1611  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1601 // MARK: - App Detection and Context-Aware Prompts
1602
1603 private func getCurrentAppInfo() -> (name: String, bundleId: String, windowTitle: String) {
1604 if let frontmostApp = NSWorkspace.shared.frontmostApplication {
1605 let name = frontmostApp.localizedName ?? "Unknown"
1606 let bundleId = frontmostApp.bundleIdentifier ?? "unknown"
1607 let title = self.getFrontmostWindowTitle(ownerPid: frontmostApp.processIdentifier) ?? ""
1608 return (name: name, bundleId: bundleId, windowTitle: title)
1609 }
1610 return (name: "Unknown", bundleId: "unknown", windowTitle: "")
1611 }
1612
1613 /// Best-effort frontmost window title lookup for the current app
1614 private func getFrontmostWindowTitle(ownerPid: pid_t) -> String? {

Calls 1

Tested by

no test coverage detected