An AppleScript to obtain the WAN IP address
Nov 03, '04 08:21:00AM
Contributed by: danva
This my first AppleScript ever so please be kind.
If you'd like to get your WAN IP address in order to SSH into your machine from outside, assuming you configured your router to forward SSH traffic (usually port 22) to your Mac, you can use this hint to obtain your WAN IP address:
You'll be presented with an option to email the IP address to the EMAILADRESS address, or to just leave the value in the system pasteboard for later use.
- Copy and paste the script into a new Script Editor document.
- Change EMAILADDRESS to an email address of your choosing
- Save the script as an application
- Invoke it
This script can be used as a basis for more tricks if required. For example, make it email the IP by default without presenting the dialog; set up an action in Mail.app for specific subject to call this script, etc. You get the idea. Just my tiny contribution for the great Mac community.
Mac OS X Hints