Browse the docs

macIP

Returns the Mac's IPv4 address on the local network.

Keyboard Maestro: MacIPAddress

Details #

macIP() takes no arguments and returns text such as 192.168.1.20. It picks the first active, non-loopback IPv4 address on an en interface (Wi-Fi or Ethernet), or any other active interface if there is none.

Parameters #

Takes 0 arguments. {{ macIP() }}

Examples #

macIP()
→

Gotchas #

  • It returns empty text when the Mac has no network connection.

  • It never returns an IPv6 address or your public address.

  • Calling it with any argument is an error: macIP() takes 0 arguments, got 1.

  • When no real Mac is behind it (tests, previews) or the Mac can't answer, it returns empty text.