Re: IP Address
Re: IP Address
- Subject: Re: IP Address
- From: Jolly Roger <email@hidden>
- Date: Wed, 07 Mar 2001 12:46:56 -0600
- Replyto: email@hidden
on 3/7/01 3:25 AM, Andrew Wylie (email@hidden) wrote:
>
--Apple's Remote Access Commands OSAX:
>
set theAddress to server name of (PPP status)
>
-- "xxx.xxx.xx.1"
AFAIK, Remote Access scripting is only helpful for people using PPP to
connect to the net.
It might be better to suggest using Network Setup Scripting as a generic
solution. I use the following script to get my current IP address:
log IPAddressFromNetworkSetup()
on IPAddressFromNetworkSetup()
set currentIP to ""
tell application "Network Setup Scripting"
try
try
open database
on error errmsg
if errmsg contains "already open" then
close database
open database
end if
end try
begin transaction
set thisConfig to the active tcpip configuration
set currentIP to IP address of TCPIP v4 configuration named
thisConfig
end transaction
close database
on error errmsg number ErrNum
abort transaction
close database
end try
return currentIP
end tell
end IPAddressFromNetworkSetup
HTH
JR