networkLocation
Returns the name of the Mac's current network location.
Keyboard Maestro: NetworkLocation
Details #
networkLocation() takes no arguments and returns the name of the active location from System Settings > Network, such as Automatic. It reads it with the networksetup tool.
Parameters #
Takes 0 arguments.
{{ networkLocation() }}
Examples #
networkLocation()→
networkLocation() == "Automatic"→
falseGotchas #
Calling it with an argument is an error:
networkLocation() takes 0 arguments, got 1.If the tool fails or takes longer than three seconds, the answer is empty text, not an error.