• 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: Way to get user's IP address into Applescript variable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Way to get user's IP address into Applescript variable?


  • Subject: Re: Way to get user's IP address into Applescript variable?
  • From: Deivy Petrescu <email@hidden>
  • Date: Thu, 08 Aug 2002 16:10:25 -0400

At 10:49 AM -0400 8/8/02, email@hidden wrote:
>I had a script that enabled me to pull in the user's IP address when I was
>running 10.1, but now that I'm running 10.2, it doesn't work anymore.
>
>Can anyone tell me if there's a better way to retrieve an IP address that
>this?
>
>set x to do shell script ("/sbin/ifconfig en0 | head -2 | grep inet | cut -d'
>' -f 2")
>display dialog x

If you want to catch all possibilities (i.e. airport as well) and in
most cases be safe with any other possible change of wording try this:

do shell script "/sbin/ifconfig -au | grep broadcast | awk '{print$2}'"



Regards

--
Deivy Petrescu
http://www.dicas.com
_______________________________________________
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: 
 >Way to get user's IP address into Applescript variable? (From: email@hidden)

  • Prev by Date: Re: osascript, root vs other users
  • Next by Date: Re: Checking the OS Version?
  • Previous by thread: Re: Way to get user's IP address into Applescript variable?
  • Next by thread: Changing AppleTalk settings under OSX?
  • Index(es):
    • Date
    • Thread