• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get IP Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Get IP Address (From: John Baltutis <email@hidden>)

  • Prev by Date: Re: Finder scripting dies
  • Next by Date: [ANN] October BAUG Meeting
  • Previous by thread: Re: Get IP Address
  • Next by thread: Re: Get IP Address
  • Index(es):
    • Date
    • Thread