Put current IP address on Clipboard AppleScript
I never remember to post these scripts which I write and often use onto the web, so that Google can index them.
So in an attempt to solve that, here we go: Here’s an AppleScript that I use often via QuickSilver. It calls Growl so - if you don’t have Growl, remove the growl parts otherwise AppleScript will ask you where GrowlHelperApp is.
set theIP to do shell script "ifconfig | grep 'broadcast' | awk '{print $2}'"
set the clipboard to theIP
tell application "GrowlHelperApp"
set defaultNotification to "Put IP address on Clipboard"
set myAllNotesList to {defaultNotification}
register as application defaultNotification all notifications myAllNotesList default notifications {defaultNotification} icon of application "Finder.app"
notify with name defaultNotification title defaultNotification description "Your IP Address (" & theIP & ") has been put on the clipboard" application name defaultNotification
end tell
Click this link to make a new Script in ScriptEditor containing the above script
PeterVk says:
Excellent - this was exactly what I was looking for. Thanks!
January 30th, 2008 at 2:28 pm
Bryan Vines says:
Thanks! The first line of the script was all I needed to get me going in the right direction.
July 31st, 2008 at 3:32 pm