• 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: Does anybody know a fast method to get out myIP?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does anybody know a fast method to get out myIP?


  • Subject: Re: Does anybody know a fast method to get out myIP?
  • From: Andrew Oliver <email@hidden>
  • Date: Thu, 01 Dec 2005 10:10:12 -0800

If you know the interface in question, the simplest method (which requires
no text or list parsing) is:

 do shell script "ipconfig getifaddr en1"

Which returns *just* the IP address, no other blurb.

Andrew
:)


On 12/1/05 8:47 AM, "Tom Brice" <email@hidden> wrote:

> This is very nice...
> FWIW here is a more complex solution that I found on the 'net a while back.
> Wish I could give credit to the author but I do not remember where it came
> from:
>
> -- try built-in ethernet first
> set myIP to ¬
>   do shell script "/sbin/ifconfig en0 | grep 'inet ' | awk '{print $2}'"
> -- the airport if not...
> if myIP is "" then
>   set myIP to ¬
>       do shell script "/sbin/ifconfig en1 | grep 'inet ' | awk '{print
> $2}'"
> end if
>
> -Tom
>
>> Try this:
>> get IPv4 address of (get system info)
>>
>> Greetings from Hamburg :-)
>> Michael Schmidt
>>
>> Am 01.12.2005 um 17:20 schrieb demski:
>>
>>> Umm,
>>> maybe I was to lousy discribing the issue:
>>> I thought of getting my internal IP on local net...
>>> (something like 192.168.1...)
>>> Maybe there is some .plist or something like that to take it from?
>>> gruss, demski
>>>
>>> Die Anderen · digitale mediendienstleistungen
>>> Bellealliancestraße 58 b  ·  20259 Hamburg
>>>
>>> fon: 040 41 26 61 81
>>> fax: 040 41 26 61 83
>>> email@hidden
>>>
>>> Am 01.12.2005 um 17:17 schrieb Emmanuel:
>>>
>>>> At 9:04 AM -0600 12/1/05, Allan McCoy wrote:
>>>>> <mailto:email@hidden>applescript-
>>>>> email@hidden on Thursday, December 1, 2005 at 5:50 AM
>>>>> -0600 wrote:
>>>>> Does anybody know a fast method to get out myIP?
>>>>>
>>>>> on the local machine:
>>>>>
>>>>> set hostName to do shell script "hostname"
>>>>> set myIP to do shell script "host " & hostname
>>>>>
>>>>> set myIP to last word of myIP
>>>>>
>>>>> or in a single line:
>>>>>
>>>>> set myIP to last word of (do shell script "host " & (do shell
>>>>> script "hostname"))
>>>>
>>>> This won't work in all cases. OMM, do shell script "hostname"
>>>> returns "emmanuel.local", that "host" doesn't resolve.
>>>>
>>>> I must confess that I know no other way of getting your IP than
>>>> connecting to whatismyip.com or some other equivalent service.
>>>>
>>>> Emmanuel
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Applescript-users mailing list      (Applescript-
>>>> email@hidden)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> 40unter-anderem.com
>>>>
>>>> This email sent to email@hidden
>>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Applescript-users mailing list      (Applescript-
>>> email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>> 40hbv.de
>>>
>>> This email sent to email@hidden
>>>
>>
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Applescript-users mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Does anybody know a fast method to get out myIP? (From: Tom Brice <email@hidden>)

  • Prev by Date: Re: CURL - what am I doing wrong?
  • Next by Date: Re: Does anybody know a fast method to get out myIP?
  • Previous by thread: Re: Does anybody know a fast method to get out myIP?
  • Next by thread: Re: Does anybody know a fast method to get out myIP?
  • Index(es):
    • Date
    • Thread