• 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: John Baltutis <email@hidden>
  • Date: Wed, 22 Oct 2003 00:53:29 -0700

On 10/21/03, Ian Ferguson <email@hidden> wrote:
>
> Here is another one. I am going to keep trying until it works for
> everybody
>
> do shell script "curl -s whatismyip.com | grep '<TITLE>' | awk '{print $4}'"
>
> On Oct 21, 2003, at 10:38 PM, Paul Skinner wrote:
>
>> This errors for me, but it's a nice solution. How about ...
>>
>> set AppleScript's text item delimiters to ":"
>> word 1 of text item 2 of (do shell script "curl
>> http://checkip.dyndns.org/";)
>>
>> On Tuesday, October 21, 2003, at 07:51 PM, Conaire Mullins wrote:
>>
>>> I use this to get my public IP address from behind a router
>>>
>>> set ip_external to characters 1 thru -2 of (words 31 thru 32 of ,
>>> ((do shell script "curl http://checkip.dyndns.org/";) as international
>>> text) as text) as text
>>> display dialog "Public IP" & ip_external

This works AS 2.0 beta, OS X 10.2.8 (the original had an extraneous comma
in it):

set ip_external to characters 1 thru -2 of (words 31 thru 32 of <no break>
((do shell script "curl http://checkip.dyndns.org/";) <no break>
as international text) as text) as text
display dialog "Public IP " & ip_external
_______________________________________________
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.

  • Follow-Ups:
    • Re: Get IP Address
      • From: Paul Skinner <email@hidden>
    • Re: Get IP Address
      • From: Chet Goetz <email@hidden>
  • Prev by Date: Color Panel/Font Panel
  • Next by Date: Finder: using "on adding folder items to..."
  • Previous by thread: Re: Get IP Address
  • Next by thread: Re: Get IP Address
  • Index(es):
    • Date
    • Thread