Saturday, January 22, 2011

Copy public IP address to clipboard via keyboard shortcut

A friend asked me for a way to put his current public IP address (which changes regularly, it seems) on the clipboard via a keyboard shortcut, and to alert him as to what value was copied. Using a combination of a shell script, Butler, and Growl (specifically, the shell command growlnotify), I was able to put together a solution for him. Note that Butler (disclaimer: I'm part of Many Tricks, Butler's developers) can be replaced by any program that lets you execute shell scripts via a hot key. You could also put the shell script in Automator, and go that route ... but I digress.

Here's the script:
#!/bin/bash MYIP=`curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.\.]*\) ...


Add to digg Add to Reddit Add to Slashdot Email this Article Add to StumbleUpon

Source: http://feeds.macosxhints.com/click.phdo?i=f0a9d86ac1802b52b7ae989b04c04c8c

macintosh support macintosh computer store apple latest news the apps store mac technical support apple sale new imac apple store uk

No comments:

Post a Comment