Getting cross-platform IP address

Dar Scott dsc at swcp.com
Wed Aug 27 17:22:40 EDT 2003


On Wednesday, August 27, 2003, at 03:09 PM, Scott Slaugh wrote:

>>> I must be missing something obvious, but is there a command that 
>>> provides the user's IP address (whether Mac or PC).
>>>
>> I'm collecting ways to do this, so I'd be pleased to see answers.
>
> Here's a script I have that does this:
>
> set the itemdel to ":"
> get HostNameToAddress(item 1 of the address)
>
> The address function should work without a connection to the internet. 
>  However, the hostNameToAddress() function does a DNS lookup, and as 
> such requires an internet connection to work properly.  (See the entry 
> in the Transcript Dictionary for hostNameToAddress for more 
> information about this.)

I'm confused.

What if I don't even know my host name or I have none or my DNS doesn't 
know it?

I think the goal is to get the primary IP address of the computer not 
of a connection.  I may be confused there, too.

Dar Scott




More information about the use-livecode mailing list