hammerspoon2-docs
    Preparing search index...
    • Listen for a distributed notification.

      Parameters

      • name: string

        The name of the notification to listen for, e.g. "com.apple.Music.playerInfo"

      • listener: (object: string | null, userInfo: Record<string, any>) => void

        Called with the notification's sender string (or null) and its userInfo object (empty if it has none) each time the notification is posted

      Returns void

      Throws an Error on failure; wrap calls in try/catch to handle it.