Re: Get IP Address
Re: Get IP Address
- Subject: Re: Get IP Address
- From: Chet Goetz <email@hidden>
- Date: Wed, 22 Oct 2003 07:51:15 -0500
The master IP checker!
(submitted for review by all you experts from this slowly learning
newbie!)
--
global ip_
global buttonPressed
global ipChosen
set ipList to {"Internal", "External"}
set temp to (choose from list ipList with prompt "Which IP would you
like?" without multiple selections allowed and empty selection allowed)
as text
set ipChosen to text of temp
if ipChosen is "External" then
set AppleScript's text item delimiters to ":"
set ip_ to word 1 of text item 2 of (do shell script "curl
http://checkip.dyndns.org/")
my displayDialog()
else
if ipChosen is "Internal" then
set ip_ to do shell script "/sbin/ifconfig en0 | grep 'inet ' | awk
'{print $2}'"
my displayDialog()
else
return
end if
end if
on displayDialog()
display dialog "Your " & ipChosen & " IP is " default answer ip_
end displayDialog
--
Chet Goetz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.