• 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: How do I get the IP address of an interface via applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get the IP address of an interface via applescript?


  • Subject: Re: How do I get the IP address of an interface via applescript?
  • From: Peter Schwenk <email@hidden>
  • Date: Mon, 13 Oct 2003 10:40:56 -0400

John:

Thanks for the info. I wasn't aware of the 'ipconfig' command, so I finally decided to whip out the 'ol 'awk' and do this:

/sbin/ifconfig en0 inet | /usr/bin/grep inet | /usr/bin/awk -F' ' '{print $2}'

On Monday, October 13, 2003, at 10:17 AM, John C. Welch wrote:
The simplest way is a do shell script with ipconfig:

/usr/sbin/ipconfig getifaddr <interfacename>, so:

do shell script "/usr/sbin/ipconfig getifaddr en0" for the built in Ethernet
port. It will return the ipaddress for that interface as a text string.

john

--
- Peter A. Schwenk | Mathematical Sciences
- email@hidden | University of Delaware
- (302) 831-0437 | Newark, DE 19716-2553 USA
_______________________________________________
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.

  • Prev by Date: Re: get seconds
  • Next by Date: Off-topic. Macintosh ROI Studies
  • Previous by thread: RE: How do I get the IP address of an interface via applescript?
  • Next by thread: Getting the Front Application
  • Index(es):
    • Date
    • Thread