Save Public IP Address to clipboard and paste

Save Public IP Address to clipboard and paste

VER: 1.0 Last Update: 190324
Author: @reboot81 at KM Forum
Based on work by @Tom http://dflect.net/ip-address-history/

PURPOSE: Get the public WAN IP and paste. I’m using ”wan,,” as trigger.

HOW TO USE:
(1) Enter ”wan,,”
(2) ”wan,,” is replaced with your public IP address.

WHAT IT DOES:
(1) Runs shell script*, pipes the result to system clipboard.
(2) Pastes system clipboard contnet.

RETURNS/SETS THESE VARIABLES:
• %SystemClipboard%

*What the shell script does in detail is covered here: https://unix.stackexchange.com/a/335403

Save Public IP Address to clipboard and paste.kmmacros (3.9 KB)

<

This myip.opendns.com doesn't work for me:

dig +short myip.opendns.com @resolver1.opendns.com
192.168.254.2

I usually do

curl ifconfig.co

This also has the upside of working if you don't have DNS resolution in the current network but an HTTP proxy. The service can also give the corresponding reverse dns name, approximative location etc.

1 Like