hammerspoon2-docs
    Preparing search index...

    Function on

    • Register a listener for application events.

      Events are reported for every application that isn't background-only, including agents (applications with no Dock icon, whose kind is "accessory"). A background-only application is reported once it changes its activation policy (didChangeActivationPolicy), and like any other from then on. Since it was already running, that change is not reported as a launch.

      Parameters

      Returns void

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