Skip to main content
Glama
CommandHelpers.swift1.02 kB
import AppKit import AXorcist import Commander import Foundation import PeekabooCore import PeekabooFoundation // MARK: - Action Extensions extension Attribute where T == String { static var hide: Attribute<String> { Attribute("AXHide") } static var unhide: Attribute<String> { Attribute("AXUnhide") } } // MARK: - Application Finding /// Async wrapper for finding applications using PeekabooCore services @MainActor func findApplication( identifier: String, services: any PeekabooServiceProviding ) async throws -> (app: Element, runningApp: NSRunningApplication) { // Use PeekabooServices to find the application let appInfo = try await services.applications.findApplication(identifier: identifier) // Get the NSRunningApplication guard let runningApp = NSRunningApplication(processIdentifier: appInfo.processIdentifier) else { throw PeekabooError.appNotFound(identifier) } let axApp = AXApp(runningApp) return (app: axApp.element, runningApp: runningApp) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/steipete/Peekaboo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server