hammerspoon2-docs
    Preparing search index...

    Namespace location

    Determine the Mac's location via macOS Location Services. Location data is obtained through WiFi network scanning and, where available, GPS hardware. User permission is required — call hs.permissions.requestLocation() before using any tracking features. The module exposes a geocoder sub-object for forward/reverse geocoding without requiring Location Services.

    Key Type Description
    latitude number Degrees north (positive) or south (negative)
    longitude number Degrees east (positive) or west (negative)
    altitude number Metres above sea level (0 if unknown)
    horizontalAccuracy number Uncertainty radius in metres (-1 if invalid)
    verticalAccuracy number Altitude accuracy in metres (-1 if invalid)
    course number Direction of travel in degrees (-1 if invalid)
    speed number Metres per second (-1 if invalid)
    timestamp number Seconds since the Unix epoch

    Functions

    addWatcher
    authorizationStatus
    distance
    get
    lookupAddress
    lookupLocation
    removeWatcher
    servicesEnabled
    sunrise
    sunset