Re: Way to get user's IP address into Applescript variable?
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.