hammerspoon2-docs
    Preparing search index...

    Function search

    • Convenience helper that creates, configures, and starts a query in one call. Equivalent to create().setQuery(predicate).setCallback(callback).start(). Call q.stop() from inside callback (when event === 'didFinish') to end the search once you have what you need.

      Parameters

      • predicate: string

        An NSPredicate-format query string

      • callback: (event: string, update?: Record<string, any>) => void

        A function called with lifecycle event name and optional update data

      Returns HSSpotlightQuery

      The HSSpotlightQuery object (use to stop the search early)