Location
Passes when the Mac is within a radius of a point on the map.
The Mac is within radius of the place
Keyboard Maestro: Location (Within, Not Within)
Details #
Asks the Mac where it is and passes when the distance to latitude, longitude is no more than radius metres. The default radius is 100 metres.
The Mac's position is a single reading, not a continuous track, and a Mac without GPS can be off by a good distance, so don't use a very small radius. The trace shows the distance in metres and the radius.
Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.
Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
latitude | any value | Yes | Latitude of the point, in decimal degrees. Accepts a number or {{ }}. | |
longitude | any value | Yes | Longitude of the point. | |
radius | any value | Distance in metres. Default 100. | ||
sample | yes / no | Used only in a dry run: the pretend answer. Default true. |
Examples #
- If the Mac is within 2000 m of (37.3349, -122.009)
- Show “Within 2 km of Apple Park”
- Else
- Show “Elsewhere”
Gotchas #
In a dry run no location is read: the condition passes with
sample(defaulttrue) and the trace sayssimulated.Needs both
latitudeandlongitude(location needs latitude and longitude).