Obtaining ALL local IP addresses for machine
Posted: Thu Feb 03, 2011 1:21 pm
Hi,
I have a script Mark shared that lets me grab the IP address for the local computer, it works well and grabs the first IP, usually the ethernet connection on the desktop macs, and the airport on the laptops.
However I have a few Macs that have both an ethernet and airport connection enabled and need to be able to get both IP addresses as im interested in communication over the airport/wifi network. Any ideas?
Thanks
Andy
Marks original script was...
function getLocalIPAddress
put "255.255.255.255:44444" into mySock
open datagram socket to mySock
put hostAddress(mySock) into myIP1
close socket mySock
return myIP1
end getLocalIPAddress
I have a script Mark shared that lets me grab the IP address for the local computer, it works well and grabs the first IP, usually the ethernet connection on the desktop macs, and the airport on the laptops.
However I have a few Macs that have both an ethernet and airport connection enabled and need to be able to get both IP addresses as im interested in communication over the airport/wifi network. Any ideas?
Thanks
Andy
Marks original script was...
function getLocalIPAddress
put "255.255.255.255:44444" into mySock
open datagram socket to mySock
put hostAddress(mySock) into myIP1
close socket mySock
return myIP1
end getLocalIPAddress